Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Error Resume Next
- Set objSysInfo = CreateObject("ADSystemInfo")
- strUser = objSysInfo.UserName
- Set objUser = GetObject("LDAP://" & strUser)
- With objUser
- strName = .FullName
- strTitle = .Department
- strJob = .Title
- End With
- strCompany = objUser.Company
- strAddress = objUser.streetAddress
- strpostalCode = objUser.postalCode
- strl = objUser.l
- strPhone = objUser.TelephoneNumber
- strMail = objuser.mail
- strWeb = objuser.wWWHomePage
- Set objword = CreateObject("Word.Application")
- With objword
- Set objDoc = .Documents.Add()
- Set objSelection = .Selection
- Set objEmailOptions = .EmailOptions
- End With
- Set objSignatureObject = objEmailOptions.EmailSignature
- Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
- With objSelection
- .ParagraphFormat.Alignment = wdAlignParagraphRight
- .TypeParagraph
- With .Font
- .Name = "Verdana"
- .Size = 10
- .Bold = false
- End With
- .TypeText strName & Chr(11)
- With .Font
- .Name = "Verdana"
- .Size = 8
- .Bold = False
- .Italic = False
- End With
- .TypeText strJob & Chr(11)
- .TypeText strTitle & Chr(11)
- .tYPEtext "Tel." & strPhone & Chr(11)
- .TypeText "Email: " & strMail & Chr(11)
- .TypeText Chr(11)
- objSelection.Font.Size = "10"
- objSelection.Font.Name = "verdana"
- objSelection.Font.Bold = True
- objSelection.TypeText strCompany
- objSelection.Font.Bold = True
- .TypeText Chr(11)
- With .Font
- .Name = "Verdana"
- .Size = 8
- .Bold = false
- End With
- .Font.Italic = False
- .TypeText strAddress & Chr(11) & strpostalCode & " - " & strl & " " & strco & Chr(11) & "Site: " & strWeb & Chr(11)
- .TypeText Chr(11)
- .InlineShapes.AddPicture "\\caminho\imagens\assinatura.jpg", True, True
- .TypeText Chr(11)
- .TypeText Chr(11)
- objSelection.Font.Size = "8"
- objSelection.Font.italic = true
- objSelection.Font.Color = 8421504
- objSelection.Font.Bold = False
- objSelection.TypeText "Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não pode usar, copiar ou divulgar as informações nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor, avise imediatamente o remetente, respondendo o e-mail, e em seguida apague-o. Agradecemos sua cooperação."
- .TypeText Chr(11)
- .TypeText Chr(11)
- objSelection.Font.Size = "8"
- objSelection.Font.italic = true
- objSelection.Font.Color = 8421504
- objSelection.Font.Bold = False
- objSelection.TypeText "This message may contain confidential and/or privileged information. If you are not the address or authorized to receive this for the address, you must not use, copy, disclose or take any action base on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation"
- End With
- Set objSelection = objDoc.Range()
- objSignatureEntries.Add "AD Signature", objSelection
- objSignatureObject.NewMessageSignature = "AD Signature"
- objSignatureObject.ReplyMessageSignature = "AD Signature"
- objDoc.Saved = True
- objword.Quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement