View Single Post
  #1  
Old February 17th 06, 05:42 PM posted to microsoft.public.outlook.program_vba
Maureen
external usenet poster
 
Posts: 40
Default How do I paste Clipboard contents using macro?

In Outlook 2002, I need a macro to insert some standard text into a new mail
message then paste the contents of the clipboard in Courier New font (to
maintain the format) below that text. With the following code I am able to
do everything except format the clipboard contents using the Courier New
font. Since I'm using Word as my editor, I created a macro in Word to search
for the first phrase in the clipboard text, then select the text and change
the font that way. That works, but my boss wants one macro in Outlook that
will accomplish everything.

Even if the whole body of the message (standard and clipboard text) is in
Courier New font, that would be fine. We don't want all messages to use that
font though.

Does anyone have any ideas how I can do that?

Public Sub ItineraryApproval()

Dim MyItem As MailItem
Dim sTempString As String

On Error Resume Next

Load TempFormForClipboard

Set MyItem = Application.CreateItem(0)

sTempString = "****NOTICE, PLEASE RESPOND ASAP****" & vbCrLf & vbCrLf &
vbCrLf
sTempString = sTempString & "Your name spelling must be same as picture
I.D. Ticketing is required 24 hours after reservations are made. Please
review the itinerary and return it signed." & vbCrLf & vbCrLf
sTempString = sTempString & "SIGNATURE________________________________"
& vbCrLf & vbCrLf
sTempString = sTempString & vbCrLf & vbCrLf & vbCrLf & MyData.GetText(1)

MyItem.Body = sTempString
MyItem.Display

Unload TempFormForClipboard

End Sub

--
Maureen
Ads