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

How do I paste Clipboard contents using macro?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old February 17th 06, 04: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
 




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
I have lost my calendar contents, where are they? execman46 Outlook - Calandaring 1 March 4th 06 08:32 AM
clipboard Joel Allen Outlook and VBA 1 January 28th 06 05:04 PM
Clipboard Joel Allen Outlook and VBA 0 January 26th 06 04:16 PM
Clicking a mail copies it to the clipboard Enrique Perez-Terron Outlook Express 3 January 21st 06 07:51 PM
how do I transfer file from Clipboard to an e-mail message tommul Outlook - General Queries 1 January 13th 06 09:22 PM


All times are GMT +1. The time now is 07:12 PM.


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.