Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Email signatures

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60146
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Email signatures
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Email signatures - 5/13/2008 2:05:37 AM   
  digitalangel78

 

Posts: 1
Score: 0
Joined: 5/13/2008
Status: offline
Hello,

I am very new to vbscript and I've been trying to write a script that will pull user infomation out of active directory to create a standardized signature for all the users on our network.  I found script from Microsoft's scripting guys to do this and the script works, almost.  It creates the signature as I want it to look and it adds it to outlook.  I then have to go to Tools-Option-Mail Format in Outlook and select the signature.  However, when I open a new email I get an error message:

"One or more ActiveX controls could not be displayed because either:

1) Your current security settings prohibit running ActiveX controls on the this page, or
2) You have blocked a publisher of one of the controls

As a result, the page must not display correctly."

I click okay and the signature appears.  However, I need to get rid of that message.  I have scoured this website and the internet for a solution to this problem with no luck.  All I can find refers to pictures, which I haven't used here.

Please help!

Here is the code I used:

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
strEmail = objUser.mail


Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
'objWord.Visible = True

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objWord.EmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

const wdcolorgreen = 32768
const wdcolorblue = 16711680

objSelection.Font.Name = "Arial"
objSelection.Font.Size = "10"
objSelection.TypeText strName
objSelection.TypeParagraph()

objselection.typetext strTitle
objSelection.TypeParagraph()

objSelection.TypeText "COMPANY"
objSelection.TypeParagraph()

objSelection.TypeText "Photographers to UK's leading schools and businesses"
objSelection.TypeParagraph()

objSelection.TypeText "www.website.biz "
objSelection.TypeParagraph()

objSelection.TypeParagraph()

objSelection.Font.Name = "Arial"
objSelection.Font.Size = "8"
objselection.font.color = wdcolorblue
objSelection.typetext "Email: " & stremail
objSelection.TypeParagraph()

objSelection.TypeText "Office: xxxxxxxxx" & " "
if strphone <> "" then objselection.typetext "Mobile: " & strPhone & "  " End If
objSelection.TypeParagraph()

objselection.font.name = "webdings"
objselection.font.size = "16"
objselection.font.color = wdcolorgreen
objselection.font.bold = true
objselection.typetext "P"
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "12"
objselection.font.color = wdcolorgreen
objselection.font.bold = true
objSelection.TypeText "Please consider the environment before printing this e-mail"
objSelection.TypeParagraph()

Set objSelection = objDoc.Range()

objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"

objDoc.Saved = True
objWord.Quit
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Email signatures Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts