![]() |
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 have the following code:
Set olApp = Outlook.Application Set onsMapi = olApp.GetNamespace("MAPI") Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder Set OlExp = olApp.ActiveExplorer Set OlSel = OlExp.Selection Set objPost = OlExp.Selection.Item(1) objPost.Display This dispalys an existing post item. I need to be able to revise this post, so I choose EDIT, Revise Contents; and the post is changed to editable version that I can modify. I wold like the code to automatically open the post item in 'revise contents' mode. Is there a way to do this programatically? Thanks, Jim |
Ads |
#2
|
|||
|
|||
![]()
You'd have to get the ID of the menu item you want and get it as a
CommandBarControl or CommandBarButton object and then call its Execute method. That's about the only way. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JimRBG" wrote in message ... I have the following code: Set olApp = Outlook.Application Set onsMapi = olApp.GetNamespace("MAPI") Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder Set OlExp = olApp.ActiveExplorer Set OlSel = OlExp.Selection Set objPost = OlExp.Selection.Item(1) objPost.Display This dispalys an existing post item. I need to be able to revise this post, so I choose EDIT, Revise Contents; and the post is changed to editable version that I can modify. I wold like the code to automatically open the post item in 'revise contents' mode. Is there a way to do this programatically? Thanks, Jim |
#3
|
|||
|
|||
![]()
Thanks Ken,
Here is what I came up with. Sub myRevisePost() Dim olApp As Outlook.Application Dim objPost As Outlook.PostItem Dim olExp As Outlook.Explorer Dim olSel As Outlook.Selection ' Get the current Folder Set olApp = Outlook.Application Set olExp = olApp.ActiveExplorer Set olSel = olExp.Selection Set objPost = olExp.Selection.Item(1) objPost.Display objPost.GetInspector.CommandBars.Item("Edit").Cont rols("Revise Contents").Execute End Sub "Ken Slovak - [MVP - Outlook]" wrote: You'd have to get the ID of the menu item you want and get it as a CommandBarControl or CommandBarButton object and then call its Execute method. That's about the only way. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JimRBG" wrote in message ... I have the following code: Set olApp = Outlook.Application Set onsMapi = olApp.GetNamespace("MAPI") Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder Set OlExp = olApp.ActiveExplorer Set OlSel = OlExp.Selection Set objPost = OlExp.Selection.Item(1) objPost.Display This dispalys an existing post item. I need to be able to revise this post, so I choose EDIT, Revise Contents; and the post is changed to editable version that I can modify. I wold like the code to automatically open the post item in 'revise contents' mode. Is there a way to do this programatically? Thanks, Jim |
#4
|
|||
|
|||
![]()
That looks good. If you ever want this to be language independent then get
the ID of that menu item and use that instead. You can use FindControl with recursive set to true to get at the menu item ("Menu Bar" is language independent) and execute it that way. Not important for a macro only you will run, but a consideration if you plan to deploy the code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JimRBG" wrote in message ... Thanks Ken, Here is what I came up with. Sub myRevisePost() Dim olApp As Outlook.Application Dim objPost As Outlook.PostItem Dim olExp As Outlook.Explorer Dim olSel As Outlook.Selection ' Get the current Folder Set olApp = Outlook.Application Set olExp = olApp.ActiveExplorer Set olSel = olExp.Selection Set objPost = olExp.Selection.Item(1) objPost.Display objPost.GetInspector.CommandBars.Item("Edit").Cont rols("Revise Contents").Execute End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Postitem | JimRBG | Outlook and VBA | 2 | October 13th 06 06:13 PM |
Usint Postitem | JimRBG | Outlook and VBA | 1 | October 13th 06 04:51 PM |
not showing the content | John | Outlook - General Queries | 0 | July 14th 06 10:34 AM |
revise telephone format in Outlook contacts | RogBob | Outlook - Using Contacts | 1 | June 8th 06 12:19 AM |
Problem in getting the content of email | Danish | Outlook Express | 1 | April 26th 06 08:46 PM |