Jump to content

Omatsei

Active Members
  • Posts

    45
  • Joined

  • Last visited

Omatsei's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I have, actually. I can't find anything. The only thing I can think of is to create new COM objects to manipulate the things I need. Edit: I found that Outlook 2007 supports Rules as objects, but not Macros. So, I guess I'm stuck with creating a new object.
  2. Does anyone know if it's possible to control the macros and rules with COM objects (and by extension, AutoIt)? I've searched, but I can't find anything too helpful. Messages, contacts, interface, etc., sure, just not macros and rules.
  3. I figured that the best and easiest way to do it is within Outlook itself, and since I only need to support XP, 2003, and 2007, the built-in VB Macros are the way to go. The short version of the story is that we have an Exchange server, and everyone keeps their messages on the server (so they can easily access them remotely). Being in education, our faculty get a lot of attachments, which really adds up. The server admin guys were complaining a bit about the size of some people's mailboxes, so we needed a way to reduce the size... Archiving works, but then the whole message is only available on the local computer, which can lead to other problems. Anyway, I thought that using VB in a rule applied to all incoming messages would greatly reduce the size of their mailbox, while keeping the attachment accessible. The only problem now is how to create the macro and apply the rule. I can create the macro in about 5 steps, then another 10 steps or so to create and apply the rule, but I'm wondering if there's an easier way. I know some of the Outlook controls can be controlled via AutoIt, which would be perfect, but I'm not sure exactly how to do it... The manual steps are basically: 1. Copy the script into the VB editor in Tools > Macros > VB Editor. 2. Save the VB Session. 3. Create a new rule and set all the appropriate options (applied to all incoming messages, run a script, specify the script, and specify exceptions to the rule). Does anyone have any experience in automating the rules in Outlook with AutoIt?
  4. Is it possible to automatically watch incoming messages in Outlook, and if certain criteria are met, do something with those messages? (In this case, I want to automatically save attachments to a custom folder, then remove the attachment from the message and replace it with an HTML link to the saved file... unless the message has the subject that starts with "Message From".)
  5. Has anyone tried to automate Office 2007 yet? I know it's not out to the general public, but since I work in a big university, we have it now. I'm trying to write a program that will completely automate the install process, but since the interface is so different, I have a feeling that it can't be done by anything other than sending keystrokes. The AutoIt Window Info never changes at all throughout the install, no matter what text, buttons, whatever, appear in the window. It makes it very difficult to work with... I have a temporary fix in place where it sends one keystroke, then waits 1/4 of a second, then sends another, and continues that until it gets to the "installing now" phase. Then I have it hit Alt-C every 15 seconds until the window closes. Overall, it's a very user-friendly interface, but it sucks for automating. Anybody else experimented with it?
  6. I'm trying to create a program that will e-mail me (or my co-worker) when a person runs it. The only information I need from the end-user is who to e-mail (or both). The problem is creating the request. I have a GUI put together to let the end-user select which support person to send the request to, but the system Microsoft put in place for sending remote assistance requests is ... inconvenient. It starts in a sort of bastardized Internet Explorer, which is the first obstacle, since I've never automated anything in IE (I'm sure I could learn, but I'm not sure if the _IE functions will work in the Remote Assistance Request window). I may be able to figure out how to do it with a series of Send()'s, but I hate doing that. It always seems very messy and inefficient, and sometimes doesn't work if they have extra toolbars or whatever installed. I've done some searches on here (by the way, the search is rather inconvenient because for each term, you have to prepend a plus sign in order for it to search for multiple terms in each post... removing the plus sign requirement would help), but I can't find anything useful. The closest was a post from a few years ago where someone mostly accomplished what I seek, but used the Send()'s, and it doesn't work on my computer now (I don't know why, but thought I'd ask if there was a simpler / better way before I tried to troubleshoot it much). Any help would be appreciated.
  7. I tried the pattern from your post, but had some problems with it. I figured it was time for me to learn a bit more about regular expressions, so I gave it a go and figured one out that works for what I need. For anyone else that needs it, here's what I ended up with: "alias (""[^""\r\n]*""|.*?\s)" That matches any string within quotes, or (if no quotes are found right after the word "alias") takes the next word. The next problem I found, which I'm not even sure is worth trying to fix, revolves around finding the 2nd field, Nickname. I have a line from my code that finds that field correctly, but if the Name field has any parenthesis in it, it fails. I know it fails because StringRegExp starts the search with the first parenthesis it finds, which is why I'm not sure if it's worth fixing it... but in case anyone knows of a really simple (read: 5 lines or less) way of fixing it, I'll just let it go. The line is: $nicknamearray = StringRegExp( $nndbase[$i], "alias " & $namearray[0] & " (""[^""\r\n]*""|.*\s)", 3)
  8. Oh, that was it. I had the beta version downloaded, but when I double-clicked something to edit it, it only opened the release version. Damn, I should have thought of that. Sorry about that... In that case, presumably, it should be a matter of figuring out the right regular expressions to use to select each field. The regexp you gave me worked perfectly for the e-mail addresses, now I just have to find one to work for the Name and Nickname fields.
  9. I can't get any useful information at all out of any RegExp. Using the code you have there, with the newest beta of AutoIT, nothing ever pops up. If I replace the _ArrayDisplay with a "msgbox(0, '', $avArray)", I get "11" again, but $avArray isn't an array... if I try "msgbox(0, '', $avArray[0])", I get an error saying that it's not an array. The problem is that if I had all the different variants, I could make a bunch of if...else...endif's that could correctly parse them all. It'd be really messy, but I could do it without having to worry too much about the regular expressions. However, every time I've tried listing all the possible permutations, inevitably, I find one or two that I missed and I have to revise my list. The longest list I ever got to was around 20-25 variants.
  10. I tried to search through the line for all the e-mail addresses, but keep getting nonsense back... $test = StringRegExp( $nndbase[$i], "[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]", 1) msgbox(0, "", $test) $nndbase[$i] is the line of text that it's currently on. It keeps giving me "11", then nothing after that. Also, I can't set the Offset to anything... if I set it, it tells me that I have an incorrect number of parameters that I'm passing to the function.
  11. Stumpii, I tried the StringRegExp last week, and only got frustrated. A couple other helpful folks on here gave me some pointers on which ones to use and how to use them (I have cursory knowledge of regular expressions, but not enough for this kind of thing), but I couldn't get it to give me the right info. For your questions, no, the middle John in that line was intentional to show how some fields need the quotes and others don't. In that case, John was the nickname, and "John Smith" was the name. To answer your second question, no, the e-mails aren't always in brackets. I think it's possible (although I haven't got a clue how to do it yet) to search through each line, grab each occurance of the @ symbol, then take any characters preceeding it (unless they're either a space, comma, bracket, quote, or double-quote), then take all the characters after it, and assign it to a variable... then repeat the process for each e-mail address in the line. I'll try to play around with the lines you suggested to see if I can get anywhere with them. Thanks!
  12. The original file is the Address Book from Eudora. I'm trying to parse that file so I can move the contacts into Outlook. I did accomplish it once, with a reasonable success rate, but it became a mess of code well over 500 lines long, that just consisted of IF...ELSE...ENDIF statements all over the place, embedded within each other, etc. Then, I found one circumstance that wouldn't work (the 3rd line above), and re-writing the existing code proved to be far more complicated than I thought it should be. Quotes are only used if the field has more than 1 word. I have a huge test file with 400+ entries that (I believe) contains all the possible circumstances.
  13. I've posted a few other topics about this, and gotten some help about specific issues I was having, but I'm having some trouble in the "theory" area. Basically, I have a text file that I have to parse, but the format of the text file changes from computer to computer. There are 2-3 main fields. The first field is the Name, and it can be in double-quotes if it's more than 1 word long, or if it has spaces or commas in it, but if it's just 1 word, it has no quotes around it. The second field is the Nickname, and it follows the same rules as the Name field, but it's optional. If it exists, I'd like to use it... if not, then just use the Name field in place of it. Here's where it gets complicated. The Name and Nickname fields exist for all contacts. The third field, e-mail address, also exists on all contacts, but there can be more than 1 e-mail address... and if there is more than 1, sometimes each address has a name associated to it. Each of those names is either in quotes itself, or in parenthesis's, or the e-mail address itself is in greater-than / less-than signs (which, from this point on, I'll refer to as "brackets" for simplicity). Here's an example of the file I'm trying to parse: alias Mary mary@company.com alias "John Smith" John john@company.com alias "Mary's Family and Friends" "Smith, John" <john@company.com>,"Mary Smith" <mary@company.com>,"'bill@elsewhere.net'" <bill@elsewhere.net>, Steve <steve@company.com> The difficulty I'm having really is visualizing what I'm trying to do. At the moment, I'm thinking that if I could step, one character at a time, through each line, I could extract each element and do whatever I want with them. However, I can't seem to figure out the best (or possible) way to do it. It should be as simple as telling it to take each character, and if it's a quote, take whatever is between those quotes, and assign it to the Name / Nickname variable, then move on... but getting that into a somewhat readable code is apparently rather difficult. It's made worse by the fact that no character is seemingly "safe" to use as a field separator, which led me to think that stepping through each line is the best way to approach it. Any suggestions would be very helpful, as I've been thinking about it all weekend and haven't come up with anything really solid.
  14. Let me ask a simpler question... I have a line of text that I want to parse. How can I step through the characters, one-by-one, and make decisions based on what each character is?
  15. All 3 methods seem to work, but what if there's dozens, and sometimes hundreds of e-mail addresses in the line? After thinking about the problem last night, I came to the conclusion that I'll probably have to create a recursive parser. alias John "Johnny Boy" jsmith@smith.com alias "Smith Company" jsmith@smith.com (John Smith), jane.smith@smith.com (Jane Smith), joe.smith@smith.com That's an example of the file I'm trying to parse... so I'm thinking it'd be easiest to start right at the beginning, then move slowly through the line, left to right, and analyze each character until I get all the information I need. That's a little over my head at the moment... For instance, I only take lines that start with the word "alias", then move past the space and analyze the next character, and depending on what it is, make my next move. If it's a double-quote, take everything within the double-quotes and assign it to the $name variable. If it's not a double-quote, take that word (until the next space) and assign it to $name. Then repeat the process for the next word / phrase and assign it to $nickname. Then do it again for $emailaddress... etc. I'm thinking I need to start with the line, then do a for...next loop with StringLeft that increments by 1 each pass... Does that sound feasible?
×
×
  • Create New...