Ser fint ud mens det køre gennem word. Men i Outlook er der dobbelt linieafsted.
'On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("
LDAP://" & strUser)
strName = objUser.FullName
strTitle = objUser.Title
strPhone = objUser.telephoneNumber
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
'Firmaer
objSelection.Font.Name = "Verdana"
objSelection.Font.Size = "10"
objWord.Selection.Font.Color = wdColorDarkRed
Set objShape = objDoc.Shapes
objSelection.TypeText "_____________________________" & VbnewLine
objSelection.Font.bold = true
objSelection.TypeText "LB KONCERNEN" & VbnewLine
objSelection.Font.bold = false
objSelection.Font.Size = "8"
'objWord.Selection.Font.Color = wdColorBlack
objSelection.TypeText "xxx G/S" & vbCrLf
objSelection.TypeText "xxx A/S ∙ xxx A/S" & vbCrLf
objSelection.TypeText "xxx A/S" & vbCrLf & vbCrLf
'Navn, Titel og telefon
objSelection.TypeText strName & vbCrLf
if strTitle <> "" then
objSelection.TypeText strTitle & vbCrLf
else
objSelection.TypeText "Title findes ikke i AD - det skal vi ligge ind" & vbCrLf
end if
if strPhone <> "" then
objSelection.TypeText "xxxxx" & strPhone
end if
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Signatur xxx", objSelection
objSignatureObject.NewMessageSignature = "Signatur xxx"
objSignatureObject.ReplyMessageSignature = "Signatur xxx"
objDoc.Saved = True
objWord.Quit
wscript.echo "Din hoved signatur er nu lavet!"