Can I differentiate between mail boxes with code?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Can I differentiate between mail boxes with code?

Post by Jaylee » Mon Feb 27, 2006 9:26 am

Sorry to keep asking questions ...

I am using a script to process email messages. The usage is spreading and I now have a number of email boxes listed in a tree formation in my Outlook client. Part of the script operation is to move the completed messages into different folders. That has been okay while I only had one email box to worry about.

In Outlook, using CTRL+SHIFT+V opens the "Move Item to" window. My problem is that all the Mailboxes appear in the &Folders: pane within that window shown with their relevant sub folders as:
- Mailbox - My Mailbox
  • - Inbox
    - Completed
- Mailbox - A second mailbox
  • - Inbox
    - Completed
+Mailbox - A third mailbox

Within the "Move Item to" window, only the first character sent by the Send Character/Text command seems to be recognised. I thought declaring the different Mailbox names as variables should have worked but either it doesn't or I'm not doing it right. ( :oops: ).

I have never attempted declaring variables before and this is what I came up with. (I have also tried different variations on this theme.) Needless to say, it didn't work:


Let>\\Mailbox - My Mailbox\Completed=Z
Send>Z


Further to this, is there a way to determine if a Mailbox tree is expanded or not? Left and Right arrow keys control expanding and collapsing trees but I dont know how to determine if a tree is already open.

I also tried renaming the destination folders using digits in front so that in My Mailbox, the "Completed" folder would show as "1-Completed". In a different Mailbox, the completed folder would show as "2-Completed", "3-Completed" and so on. Using Send>1 or Send>2 etc will locate the correct folder but only if the tree is expanded.

I would welcome any ideas or suggestions to help me learn this.

TIA. :D
J

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 27, 2006 4:58 pm

The best way to script Outlook is via VBScript and Outlook's COM object. Seach these forums for "outlook" and you will find 60 odd posts.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Post by Jaylee » Tue Feb 28, 2006 8:53 am

Thank you for the suggestion Marcus. Unfortunately, the version of MS that I am using originated sometime during the late Jurassic period and tells me it does not support VBScript.

Until I can gain approval to upgrade, I need to work with what I've got. I will probably workaround the problem by renaming the destination folders with a numeral in front and use Send>1, Send>2, etc for the moment and will just have to be vigilant in ensuring the folder trees stay expanded in the "Move Item to" window.

Thanks again.

J. :D

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Feb 28, 2006 8:57 am

Wow, you must have a very old version!

Note also that the latest version (8.0) has a GetTreeNode function to help you work with treeviews. Might be helpful.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts