Answered by:
Compatibility Issue between OL 03 and 07

Question
-
I am using VBScript to create a default email signature pulling AD info. Below that I am using a table to stack our confidentiality notice and our social media links side by side to reduce the size of the signature.
In Outlook 2003, the signature looks exactly how I want it to look. However, in 2007 the text moves to the position directly after the icons we use for the social media and just continue on as if it is a normal paragraph.
If needed I can post the code.
Thanks for any help!
- Moved by Bill_Stewart Thursday, September 26, 2013 7:53 PM Move to more appropriate forum
Thursday, September 26, 2013 6:22 PM
Answers
-
I would definitely use a template and just assign the field variables. Just open word and create a new document from the template then assign the fields and generate the signatures. Two templates - one for each version.
Looking at the code it is highly likely that you are not locking down the flow. Locking down a documents flow is very difficult if you have no template. The document will be at the mercy of whatever is in "normal.dot". This is at the mercy of the user. You would need to set all of the variables in the document to get there. This is what a stock template does.
Post in Word VBA to see what they have to say about forcing the rendering in the two versions.
You could also do all positioning and sizing based on inches or meters and the two would be the same.
¯\_(ツ)_/¯
- Edited by jrv Thursday, September 26, 2013 9:06 PM
- Marked as answer by George Hua Monday, October 14, 2013 6:48 PM
Thursday, September 26, 2013 9:05 PM
All replies
-
Two things come to mind.
1. Use a template for the signature and just populate the variables in the template.
2. You are likely no setting the formatting correctly to lock the "flow" positioning. That can cause different versions to render differently.I would start by trying to build two templates with named fields of fixed size. Pick the template based on the version of Word you are using.
You should also post your issue in the Word VBA for Developers Forum. Don't concentrate on VBScript. Concentrate on how to do it using VBA. Once you understand how it is done in VBA then translate it to VBScript.
Exchange 2007 and later have signature inclusion and generation on the server. This should force compatibility as it uses CSS style sheets and HTML to generate very detailed signatures.
Other than that there is nothing we can do for you without seeing your script.
¯\_(ツ)_/¯
Thursday, September 26, 2013 7:54 PM -
Here is my current code. We are running Exchange 2003. This parses out exactly how I want it in OL 2003, but gets weird in Outlook 2007.
On Error Resume Next
set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
set objUser = GetObject("LDAP://" & strUser)
strFName = objUser.FirstName
strLName = objUser.LastName
strDisplayName = objUser.displayName
strDescription = objUser.description
strCompany = objUser.company
strOffice = objUser.physicalDeliveryOfficeName
strAddress = objUser.streetAddress
strState = objUser.St
strCity = objUser.l
strPostal = objUser.postalCode
strPhone = objUser.telephoneNumber
strFax = objUser.faxNumber
strEmail = objUser.emailAddress
strTitle = objUser.title
strDepartment = objUsr.department
strPo = objUser.postOfficeBox
strHomePhone = objUser.homePhone
strIPPhone = objUser.IPPhone
strWebpage = objUser.wWWHomePage
'strImage = objWord.Pictures.Insert(path)
objfile.write "<hr>"
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
'list of all known variables: Description, FirstName, LastName, DisplayName,
'Company, streetAddress, St, l, postalCode, telephoneNumber, faxNumber, emailAddress,
'department, title, initials, postofficebox, pager, mobile, homephone, ipphone, c, o, notes,
'physicalDeliveryOfficeName, wWWHomePage'Display tagline
objWord.Visible = false
objSelection.Font.Name = "Calibri"
objSelection.Font.Size = "12"
objSelection.Font.Color = RGB (0,0,153)
objSelection.Font.Bold = True
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText(strDisplayName)
objSelection.Font.Name = "Calibri"
objSelection.Font.Size = "9"
objSelection.Font.Color = RGB (0,0,153)
objSelection.Font.Bold = False
objSelection.TypeParagraph()
if not strTitle = "" then
objSelection.TypeText(strTitle)
end if
objSelection.TypeParagraph()
'picture
objWord.Selection.InlineShapes.AddPicture("path")
objSelection.TypeParagraph()
'Company and Branch
objSelection.Font.Size = "12"
objSelection.Font.Color = RGB (0,0,153)
objSelection.Font.Bold = True
if strCompany <> "" then
objSelection.TypeText(strCompany)
end if
if strOffice <> "" or strCompany <> "" then
objSelection.Font.Size = "9"
objSelection.Font.Color = RGB (0,0,153)
objSelection.Font.Bold = False
objSelection.TypeText(" | ")
end if
'Address, PO, city, state, zip
if strAddress <> "" thenobjSelection.TypeText(strAddress)
objSelection.TypeText(", ")
end if
'if strAddress <> "" and strPO <> "" then
'objSelection.TypeText(", ")
'end if
if strPo <> "" then
objSelection.TypeText(strPo)
end if
if strPo <> "" and strCity <> "" then
objSelection.TypeText(", ")
end if
if strCity <> "" then
objSelection.TypeText(strCity)
end if
if strCity <> "" and strState <> "" then
objSelection.TypeText(", ")
end if
if strState <> "" then
objSelection.TypeText(strState)
end if
if strPostal <> "" then
objSelection.TypeText(" ")
objSelection.TypeText(strPostal)
end if
if strAddress <> "" or strPo <> "" or strCity <> "" or strState <> "" or strPostal <> "" then
objSelection.TypeText(" | ")
end if
'Phone, IPPhone, fax, email
if strIPPhone <> "" then
objSelection.TypeText("p: ")
objSelection.TypeText(strIPPhone)
objSelection.TypeText(" | ")
end if
if strFax <> "" then
objSelection.TypeText("f: ")
objSelection.TypeText(strFax)
end if
if strFax <> "" and strEmail <> "" then
end if
if not strEmail = "" then
objSelection.TypeText(" | ")
objSelection.TypeText("e: ")
objSelection.TypeText(strEmail)
end if
if strEmail<> "" and strWebpage <> "" then
end if
if not strWebpage = "" then
objSelection.TypeText(" | ")
objSelection.TypeText(strWebpage)
end if
if strIPPhone <> "" or strHomePhone <> "" or strFax <> "" or strEmail <> "" or strwebPage <>"" then
end if
Const NUMBER_OF_ROWS = 1
Const NUMBER_OF_COLUMNS = 2Set objRange = objSelection.Range
objDoc.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
Set objTable = objDoc.Tables(1)
objTable.Columns.Item(1).SetWidth 400,0objTable.Cell(1, 1).Select
objSelection.Font.Size = "8"
objTable.Cell(1, 1).Range.Text = "Confidentiality Notice: This email and the documents accompanying it may contain certain confidential information. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, you are notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of the email information is prohibited. If you have received this email in error, please notify us immediately by replying to this email or call in 800-678-0987. Thank you."
'objSelection.TypeParagraph()
'objSelection.TypeText("If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this message or any attachments is strictly prohibited.")
'objSelection.TypeParagraph()
'objSelection.TypeText("If you have received this message in error, please notify us immediately by replying to the sender. Please delete all copies of this message and its attachments from your system. Thank you.")
objTable.Cell(1, 2).Select
objTable.Cell(1, 2).Range.Text = objWord.Selection.InlineShapes.AddPicture("path")
objWord.Selection.InlineShapes.AddPicture("path")
objWord.Selection.InlineShapes.AddPicture("path")
objSelection.EndKey 6
objSelection.TypeParagraph()
'CRS
objWord.Selection.InlineShapes.AddPicture("path")
objSelection.Font.Size = "12"
objSelection.Font.Color = RGB (100,170,75)
objSelection.TypeText(" Please print this email responsibly.")
Set objSelection = objDoc.Range()
objSignatureEntries.Add "MyDefaultSig", objSelection
objSignatureObject.NewMessageSignature = "MyDefaultSig"
objDoc.Saved = True
objWord.Quit()'wscript.echo "A new Signature has been applied on your Outlook program!"
Thursday, September 26, 2013 8:40 PM -
I would definitely use a template and just assign the field variables. Just open word and create a new document from the template then assign the fields and generate the signatures. Two templates - one for each version.
Looking at the code it is highly likely that you are not locking down the flow. Locking down a documents flow is very difficult if you have no template. The document will be at the mercy of whatever is in "normal.dot". This is at the mercy of the user. You would need to set all of the variables in the document to get there. This is what a stock template does.
Post in Word VBA to see what they have to say about forcing the rendering in the two versions.
You could also do all positioning and sizing based on inches or meters and the two would be the same.
¯\_(ツ)_/¯
- Edited by jrv Thursday, September 26, 2013 9:06 PM
- Marked as answer by George Hua Monday, October 14, 2013 6:48 PM
Thursday, September 26, 2013 9:05 PM