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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image position in a vb signature for outlook

Status
Not open for further replies.

slobad23

IS-IT--Management
Jun 30, 2006
90
GB
I have a vb script that runs through a logon group policy and creates a signature for outlook.

The information is taken from active directory objects and creates a signature personal to the user.

There is a logo that I want to add to the signature too and this is placed at the top of the signature.

The logo just places itself in the top left of the email body and was covering the text. I added paragraph objects to move the text down so that the image was not covering the text and trial and error got me to a point where it looked ok.

When I tried the same signature in outlook 2003 it took a paragraph object a little differently and the text was very far away from the logo.

Is there a way to keep the position of the logo constant across outlook versions? I may have done something unclever with the image insert and hopefully you can give me some pointers.

Below is the code from the group policy logon used to create the signature:

Code:
On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

Set WshShell = CreateObject("WScript.Shell")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strName = objuser.cn
strTitle = objUser.Title
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strCounty = objuser.st
strPostCode = objUser.PostalCode
strCompany = objuser.Company
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection


Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.Font.Name = "Arial"
objSelection.Font.Size = 16
objSelection.TypeText strName
objSelection.Font.Name = "Arial"
objSelection.Font.Size = 11
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "Phone: " & strPhone
objSelection.TypeText Chr(11)
if (strFax) Then objSelection.TypeText "Fax: " & strFax & Chr(11)
if (strMobile) Then objSelection.TypeText "Mobile: " & strMobile & Chr(11)
objSelection.TypeText "email: " & strEmail
objselection.TypeText Chr(11)
objselection.TypeText Chr(11)
objSelection.TypeText strCompany
objSelection.TypeText Chr(11)
objSelection.TypeText strStreet & ", " & strCounty & ", " & strPostCode
objSelection.TypeText Chr(11)
objSelection.TypeText "________________________________________________________"
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "disclaimer text
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "disclaimer text"
objSelection.TypeText Chr(11)
objSelection.TypeText "________________________________________________________"
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "disclaimer text
Set objShape = objDoc.Shapes
objShape.AddPicture("\\server\Logos\sig_icon.jpg")

Set objSelection = objDoc.Range()

objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"

objDoc.Saved = True
objWord.Quit

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.Font.Name = "Arial"
objSelection.Font.Size = 10
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName
objSelection.TypeParagraph()
objSelection.TypeText strTitle
objSelection.TypeText Chr(11)

Set objSelection = objDoc.Range()

objSignatureEntries.Add "Reply Signature", objSelection

objSignatureObject.ReplyMessageSignature = "Reply Signature"

objDoc.Saved = True
objWord.Quit
 
you may be stuck with maintaining a different method depending on the version and therefore in your script check which version it is and act accordingly?
i am afraid for me your are breaking the ice, dont have any experience which mail signatures
 
The best way to do what you want is to design the signature in HTML using spreadsheet like tables and placing the graphics and text into cells.

I have a VBscript that does it, but I will have to post it tonight because it is on my home network.

Let me know if you would like it.

There is also a great program for doing this call eMailSignature. The US distributor is AACO Techology.
eMailSignature
AACO Technology LLC

Let them know that I referred you. Nathan will take good care of you at ACCO.


Thanks

John Fuhrman
faq329-6766
 
remove the following lines

Set objShape = objDoc.Shapes
objShape.AddPicture("\\server\Logos\sig_icon.jpg")

and replace with

Set objShape = objSelection.InlineShapes.AddPicture("\\server\Logos\sig_icon.jpg")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top