Advertisement
Guest User

ASSINATURA AD OUTLOOK

a guest
Nov 18th, 2019
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. On Error Resume Next
  2. Set objSysInfo = CreateObject("ADSystemInfo")
  3. strUser = objSysInfo.UserName
  4. Set objUser = GetObject("LDAP://" & strUser)
  5. With objUser
  6. strName = .FullName
  7. strTitle = .Department
  8. strJob = .Title
  9. End With
  10.  
  11. strCompany = objUser.Company
  12. strAddress = objUser.streetAddress
  13. strpostalCode = objUser.postalCode
  14. strl = objUser.l
  15.  
  16. strPhone = objUser.TelephoneNumber
  17. strMail = objuser.mail
  18. strWeb = objuser.wWWHomePage
  19.  
  20.  
  21. Set objword = CreateObject("Word.Application")
  22. With objword
  23.  
  24. Set objDoc = .Documents.Add()
  25. Set objSelection = .Selection
  26. Set objEmailOptions = .EmailOptions
  27. End With
  28.  
  29. Set objSignatureObject = objEmailOptions.EmailSignature
  30. Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
  31. With objSelection
  32.  
  33. .ParagraphFormat.Alignment = wdAlignParagraphRight
  34. .TypeParagraph
  35.  
  36. With .Font
  37. .Name = "Verdana"
  38. .Size = 10
  39. .Bold = false
  40. End With
  41. .TypeText strName & Chr(11)
  42. With .Font
  43. .Name = "Verdana"
  44. .Size = 8
  45. .Bold = False
  46. .Italic = False
  47. End With
  48. .TypeText strJob & Chr(11)
  49. .TypeText strTitle & Chr(11)
  50. .tYPEtext "Tel." & strPhone & Chr(11)
  51. .TypeText "Email: " & strMail & Chr(11)
  52. .TypeText Chr(11)
  53.  
  54. objSelection.Font.Size = "10"
  55. objSelection.Font.Name = "verdana"
  56. objSelection.Font.Bold = True
  57. objSelection.TypeText strCompany
  58. objSelection.Font.Bold = True
  59. .TypeText Chr(11)
  60.  
  61.  
  62. With .Font
  63. .Name = "Verdana"
  64. .Size = 8
  65. .Bold = false
  66. End With
  67. .Font.Italic = False
  68. .TypeText strAddress & Chr(11) & strpostalCode & " - " & strl & " " & strco & Chr(11) & "Site: " & strWeb & Chr(11)
  69. .TypeText Chr(11)
  70. .InlineShapes.AddPicture "\\caminho\imagens\assinatura.jpg", True, True
  71.  
  72. .TypeText Chr(11)
  73. .TypeText Chr(11)
  74. objSelection.Font.Size = "8"
  75. objSelection.Font.italic = true
  76. objSelection.Font.Color = 8421504
  77. objSelection.Font.Bold = False
  78. 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."
  79.  
  80. .TypeText Chr(11)
  81. .TypeText Chr(11)
  82. objSelection.Font.Size = "8"
  83. objSelection.Font.italic = true
  84. objSelection.Font.Color = 8421504
  85. objSelection.Font.Bold = False
  86. 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"
  87.  
  88.  
  89. End With
  90.  
  91.  
  92. Set objSelection = objDoc.Range()
  93. objSignatureEntries.Add "AD Signature", objSelection
  94. objSignatureObject.NewMessageSignature = "AD Signature"
  95. objSignatureObject.ReplyMessageSignature = "AD Signature"
  96. objDoc.Saved = True
  97. objword.Quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement