A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Postitem - revise content



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 20th 06, 12:36 AM posted to microsoft.public.outlook.program_vba
JimRBG
external usenet poster
 
Posts: 9
Default 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

Ads
  #2  
Old October 20th 06, 03:35 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


  #3  
Old October 25th 06, 12:05 AM posted to microsoft.public.outlook.program_vba
JimRBG
external usenet poster
 
Posts: 9
Default 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



  #4  
Old October 25th 06, 05:10 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 09:29 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-2025 Outlook Banter.
The comments are property of their posters.