![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I need to create a "Script" for a "run a script" rule action.
I am new to the Outlook object model, but familiar with VBScript. I could use a pointer to some documentation, as I haven't found anything clear and straightforward. My immediate issue is accessing the body text of a message to evaluate the contents. I think the shortest question might be... What is the method/syntax to get the body text, and what type of variable is it, string, collection, etc.? I can work with it once I get a handle to it... -- Trey Shaffer |
Ads |
#2
|
|||
|
|||
![]()
It's a string, Body.
Use this syntax for your "run a script" rule to avoid security prompts in Outlook 2003: Sub RunAScriptRuleRoutine(MyMail As MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) ' do stuff with olMail, e.g. MsgBox olMail.Body Set olMail = Nothing Set olNS = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Trey Shaffer" wrote in message ... I need to create a "Script" for a "run a script" rule action. I am new to the Outlook object model, but familiar with VBScript. I could use a pointer to some documentation, as I haven't found anything clear and straightforward. My immediate issue is accessing the body text of a message to evaluate the contents. I think the shortest question might be... What is the method/syntax to get the body text, and what type of variable is it, string, collection, etc.? I can work with it once I get a handle to it... -- Trey Shaffer |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MailItem.Save for "Reply" | [email protected] | Add-ins for Outlook | 0 | March 5th 06 06:14 PM |
How can I create a MailItem that displays like a received MailItem ? | Clive | Outlook - Using Forms | 0 | February 27th 06 04:14 PM |
Losing handle to MailItem when send | donald | Add-ins for Outlook | 8 | February 1st 06 06:09 PM |
Read Msgs Marked as Read? | ERoss | Outlook - General Queries | 0 | January 23rd 06 06:44 PM |
dialog comes up when trying to access mailItem | Neo | Add-ins for Outlook | 3 | January 16th 06 09:56 PM |