Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Postitem - revise content (http://www.outlookbanter.com/outlook-vba/30534-postitem-revise-content.html)

JimRBG October 20th 06 12:36 AM

Postitem - revise content
 
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


Ken Slovak - [MVP - Outlook] October 20th 06 03:35 PM

Postitem - revise content
 
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



JimRBG October 25th 06 12:05 AM

Postitem - revise content
 
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




Ken Slovak - [MVP - Outlook] October 25th 06 05:10 PM

Postitem - revise content
 
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




All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com