Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook2K-VBA-PasteSpecial

Status
Not open for further replies.

chesnuttjh

Technical User
Jul 7, 2001
2
US
I need some help in VBA programming in Outlook2K.

I am running Outlook2K with Office2K. I have a mailitem open with the cursor in the message body. At the cursor point, I want to paste from the clipboard formatted text copied from a Word2K document.

I want to do the pasting by executing from the menu bar Edit-PasteSpecial-PasteAs-Formatted Text (RTF) - OK entirely in VBA without using Sendkeys.

I have prepared a macro that has the following VBA code that works to the point of executing Edit-PasteSpecial-PasteAs- and opening up the dialog box that will let me select Formatted Text (RTF) and then press OK, but I have been unable to determine the VBA code that will actually select Formatted Text (RTF) and then press OK to complete the paste.

Dim objOLApp As Outlook.Application
Dim objNS As NameSpace
Dim ctlCBarControl As CommandBarControl

Set objOLApp = New Outlook.Application
Set objNS = objOLApp.GetNamespace("MAPI")

Set ctlCBarControl = Application.ActiveInspector _
.CommandBars("Menu Bar").Controls("Edit") _
.Controls("Paste Special...")
ctlCBarControl.Execute

Please let me know the additional VBA code that I need to actually select Formatted Text (RTF) and then press OK to complete the paste, without using Sendkeys.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top