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

Command Button to insert Email Signature



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 20th 09, 02:18 PM posted to microsoft.public.outlook.program_vba
JK
external usenet poster
 
Posts: 1
Default Command Button to insert Email Signature

I want to create a command button in Outlook 03 that would automatically
insert an email signature. One way was to copy the signature, record a new
macro and then click paste. These instructions I found online don't work
becuase all the macro is doing is pasting whatever is in the clipboard. If
you copy something else or restart the PC the macro fails.

So I think the best way is to hardcode it using VBA. I have the following
example that I found online and it works except it does not account for
formatting. One of the owners of the business I work for wants the ability to
easily insert a signature. However, he would also like to be able to select
the font for the sig which may or may not be the same as the message body.

I need to be able to program the selected font, size, and bold/italic
directly into the code below. I've never done this - does anyone know where I
could find an example of this online or be able to tell me how to do it?

Oh, and you'll notice I commented out the last line in the following code
"MyRange.InsertAfter (MyText)" if I don't comment it out the text is printed
twice?

Thanks,
Jason

Sub InsertAfterMethod()
Dim MyText As String
Dim MyRange As Object

Set MyRange = ActiveDocument.Range
MyText = "Jason Kaloyanides" '& vbCrLf & "Job Title" & vbCrLf & "Address"

' Selection Example:
Selection.InsertAfter (MyText)

' Range Example:
' (Inserts text at the current position of the insertion point.)
MyRange.Collapse
' MyRange.InsertAfter (MyText)
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
Create macro to insert signature into email... Fuel451 Outlook and VBA 8 December 31st 09 02:26 PM
How do I add the button that inserts my signature in new email? Mommyanna91701 Outlook - Installation 3 August 29th 08 06:54 PM
Signature Button and Insert Signature Missing Bill Glidden Outlook - General Queries 2 December 19th 06 08:42 AM
Command buttons when using word as email button [email protected] Add-ins for Outlook 1 October 9th 06 09:27 PM
Delete Excel Command Button Before Email is Sent White Horse Outlook and VBA 1 April 28th 06 06:01 AM


All times are GMT +1. The time now is 05:03 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.