Moin Moin,
ich beschäftige mich gerade mit Email Signaturen und möchte die gerne über VBS zentral verwalten und verteilen.
Habe dazu auch einen Netten VB Script, der auch wunderbar funktioniert, allerdings gefällt mir das Format nicht und ich bekomme es auf biegen und brechen nicht hin.
QuellCode:
' Signature stuff
strName = objUser.givenName + " " + objUser.sn
strDepart = objUser.Department
strDesc = objUser.Description
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strCompany = objUser.Company
strCompany2 = objUser.Company2
aQuote = Chr(34)
aNewLine = Chr(11)
If strCompany = "Dummyhausen" then
strCompanyTitle = "Foobar company Dummyhausen"
strCompanyWeb = "http://www.specialpage.de"
Else
strCompanyTitle = "XXX GmbH & Co. KG"
strCompanyWeb = "http://xxx.com"
End If
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
objSelection.TypeText "Mit freundlichem Grüßen" + aNewLine
objSelection.TypeText "i.A." & vbCrLf
if (strCred) Then objSelection.TypeText strCred & strName Else objSelection.TypeText strName
objSelection.TypeText vbCrLf & vbCrLf
' Bold
objSelection.Font.Bold = True
objSelection.TypeText strCompanyTitle + aNewLine
objSelection.Font.Bold = False
' not bold
objSelection.TypeText vbCrLf & vbCrLf
if (strCred) Then objSelection.TypeText strCred & strName Else objSelection.TypeText strName
objSelection.TypeText aNewLine
objSelection.TypeText vbCrLf
objSelection.TypeText strStreet & aNewLine
objSelection.TypeText strPostCode & " " & strLocation & aNewLine
objSelection.TypeText "Tel: " & strPhone & aNewLine
if (strFax) Then objSelection.TypeText "Fax: " & strFax & aNewLine
if (strMobile) Then objSelection.TypeText "Mobil: " & strMobile & aNewLine
objSelection.TypeText vbCrLf
objDoc.Hyperlinks.Add objSelection.Range, "Mailto:" & strEmail, , , strEmail & aNewLine
'objSelection.TypeText " && "
objDoc.Hyperlinks.Add objSelection.Range, strCompanyWeb, , ,strCompanyWeb
objSelection.TypeText vbCrLf
objSelection.TypeText "________________________________"
objSelection.TypeText vbCrLf & vbCrLf
objSelection.TypeText "ABSPANN Deutsch"
objSelection.TypeText vbCrLf & vbCrLf
objSelection.TypeText "ABSPANN Englisch"
objSelection.TypeText vbCrLf
Set objSelection = objDoc.Range()
' full signature
objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"
objDoc.Saved = True
' reply signature
objSignatureEntries.Add "Reply Signature", objSelection
objSignatureObject.ReplyMessageSignature = "Reply Signature"
objDoc.Saved = True
' EOF
Das ganze sieht dann so aus:
Mit freundlichem Grüßen
i.A.
Max Mustermann
Muster GmbH & Co. KG
Max Mustermann
Leipziger Straße 198
12345 Musterhausen
Tel: +491234567
Fax: +491651651
Max.Muster@Musterfirma.de
http://google.de
________________________________
ABSPANN Deutsch
ABSPANN Englisch
So sollte es aber aussehen:
Mit freundlichen Grüßen
i.A. Max MUstermann
max.mustermann@musterfirma.de
www.google.de
Musterfirma GMBH & Co KG
FIRMENBEZEICHNUNG
Musterstrasse
Muster Ort
Abspann Deutsch
Abspann Englisch
ich beschäftige mich gerade mit Email Signaturen und möchte die gerne über VBS zentral verwalten und verteilen.
Habe dazu auch einen Netten VB Script, der auch wunderbar funktioniert, allerdings gefällt mir das Format nicht und ich bekomme es auf biegen und brechen nicht hin.
QuellCode:
' Signature stuff
strName = objUser.givenName + " " + objUser.sn
strDepart = objUser.Department
strDesc = objUser.Description
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strCompany = objUser.Company
strCompany2 = objUser.Company2
aQuote = Chr(34)
aNewLine = Chr(11)
If strCompany = "Dummyhausen" then
strCompanyTitle = "Foobar company Dummyhausen"
strCompanyWeb = "http://www.specialpage.de"
Else
strCompanyTitle = "XXX GmbH & Co. KG"
strCompanyWeb = "http://xxx.com"
End If
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
objSelection.TypeText "Mit freundlichem Grüßen" + aNewLine
objSelection.TypeText "i.A." & vbCrLf
if (strCred) Then objSelection.TypeText strCred & strName Else objSelection.TypeText strName
objSelection.TypeText vbCrLf & vbCrLf
' Bold
objSelection.Font.Bold = True
objSelection.TypeText strCompanyTitle + aNewLine
objSelection.Font.Bold = False
' not bold
objSelection.TypeText vbCrLf & vbCrLf
if (strCred) Then objSelection.TypeText strCred & strName Else objSelection.TypeText strName
objSelection.TypeText aNewLine
objSelection.TypeText vbCrLf
objSelection.TypeText strStreet & aNewLine
objSelection.TypeText strPostCode & " " & strLocation & aNewLine
objSelection.TypeText "Tel: " & strPhone & aNewLine
if (strFax) Then objSelection.TypeText "Fax: " & strFax & aNewLine
if (strMobile) Then objSelection.TypeText "Mobil: " & strMobile & aNewLine
objSelection.TypeText vbCrLf
objDoc.Hyperlinks.Add objSelection.Range, "Mailto:" & strEmail, , , strEmail & aNewLine
'objSelection.TypeText " && "
objDoc.Hyperlinks.Add objSelection.Range, strCompanyWeb, , ,strCompanyWeb
objSelection.TypeText vbCrLf
objSelection.TypeText "________________________________"
objSelection.TypeText vbCrLf & vbCrLf
objSelection.TypeText "ABSPANN Deutsch"
objSelection.TypeText vbCrLf & vbCrLf
objSelection.TypeText "ABSPANN Englisch"
objSelection.TypeText vbCrLf
Set objSelection = objDoc.Range()
' full signature
objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"
objDoc.Saved = True
' reply signature
objSignatureEntries.Add "Reply Signature", objSelection
objSignatureObject.ReplyMessageSignature = "Reply Signature"
objDoc.Saved = True
' EOF
Ergänzung ()
Das ganze sieht dann so aus:
Mit freundlichem Grüßen
i.A.
Max Mustermann
Muster GmbH & Co. KG
Max Mustermann
Leipziger Straße 198
12345 Musterhausen
Tel: +491234567
Fax: +491651651
Max.Muster@Musterfirma.de
http://google.de
________________________________
ABSPANN Deutsch
ABSPANN Englisch
Ergänzung ()
So sollte es aber aussehen:
Mit freundlichen Grüßen
i.A. Max MUstermann
max.mustermann@musterfirma.de
www.google.de
Musterfirma GMBH & Co KG
FIRMENBEZEICHNUNG
Musterstrasse
Muster Ort
Abspann Deutsch
Abspann Englisch
Zuletzt bearbeitet: