VBScript Signatures in Outlook 2003

B

benb

Hi,

In this months TechNet magazine, there is a couple of pages on scripting
signatures in outlook. One of the sample scripts is a vbscript that queries
active directory, pulls out the user info and then inserts it as a
signature. However the article doesn't say how to set this script up in
outlook. I've tried just adding the script to a signature, but when you
insert the signature it just displays the script. How do I assign the script
to the signature so that it will work correctly?

Many thanks

Ben

P.S. Script is below

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strName = objUser.FullName
strTitle = objUser.Title
strDepartment = objUser.Department
strCompany = objUser.Company
strPhone = objUser.TelephoneNumber

Set objWord = GetObject("Word.Application")
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObjects = objWord.EmailOptions.EmailSignature

Set objSignatureEntries = objWordSignatureObjects.EmailSignatureEntries

objSelection.TypeText strName & ", " & strTitle
objSelection.TypeParagraph()
objSelection.TypeText strDepartment
objSelection.TypeParagraph()
objSelection.TypeText strCompany
objSelection.TypeParagraph()
objSelection.TypeText strPhone

Set objSelection = objDoc.Range()

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

objDoc.Save = True
objWord.Quit
 
S

Sue Mosher [MVP-Outlook]

Signature files for Outlook 2003 reside in the %appdata%\Microsoft\Signatures folder but are set in Outlook for each account. You can use a script like that at http://www.outlookcode.com/codedetail.aspx?id=821 to apply the signature to each account.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

Alice Zhu [MSFT]

Hi Ben,

The issue seems to be a coding issue.

For assistance with this, please consider these resources:

1. MSDN newsgroups
http://msdn.microsoft.com/newsgroups/default.asp
Category: Office Solutions Development\Outlook\outlook.vba

2. Public newsgroups for peer experiences and recommendations:
microsoft.public.outlook.program_vba

3. ISV Advisory Services
If you have the ISV Competency, Microsoft Global Partner Support
Delivery ISV team offers the advisory services to your development projects
with best practices, .Net migration guidance, architecture guidance, code
samples and technology workshops.
Advisory services are offered as part of the partner benefits at no
extra charge.

The services can be accessed either by email or phone:
(e-mail address removed) (for Gold Partners)
(e-mail address removed) (for Certified Partners)
(e-mail address removed) (for Empower Partners)

Phone: 1-800-426-9400, option 4, your partner level member services,
and follow the instructions for ISV advisory services.

I hope this information is helpful in getting started and we invite you to
post again with any specific break/fix issues.

By the way, thanks to Sue.

Have a nice day!

Regards,
Alice Zhu

Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alice Zhu [MSFT]

Hi Ben,

Thank you for your reply. If you encounter any new break/fix issue, please
feel free to post in the newsgroups. You are welcome.

Regards,
Alice Zhu

Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top