Group:  Microsoft Outlook ยป microsoft.public.outlook.general
Thread: VBScript Signatures in Outlook 2003

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

VBScript Signatures in Outlook 2003
"benb" <benblackmore[ at ]nospam.postalias> 22.09.2006 10:29:05
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


Re: VBScript Signatures in Outlook 2003
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 22.09.2006 11:32:48
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"benb" <benblackmore[ at ]nospam.postalias> wrote in message news:OGbAvHj3GHA.4648[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> 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
>
>
RE: VBScript Signatures in Outlook 2003
v-alzhu[ at ]online.microsoft.com (Alice Zhu [MSFT]) 25.09.2006 05:30:47
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:
isvgold[ at ]microsoft.com (for Gold Partners)
isvcert[ at ]microsoft.com (for Certified Partners)
isvreg[ at ]microsoft.com (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.


Re: VBScript Signatures in Outlook 2003
"benb" <benblackmore[ at ]nospam.postalias> 25.09.2006 09:22:29
Hi Alice,

Thanks for the reply. I will try in those newsgroups.

Cheers

Ben

"Alice Zhu [MSFT]" <v-alzhu[ at ]online.microsoft.com> wrote in message
news:crP$CPG4GHA.4280[ at ]TK2MSFTNGXA01.phx.gbl...
[Quoted Text]
> 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:
> isvgold[ at ]microsoft.com (for Gold Partners)
> isvcert[ at ]microsoft.com (for Certified Partners)
> isvreg[ at ]microsoft.com (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.
>
>


Re: VBScript Signatures in Outlook 2003
v-alzhu[ at ]online.microsoft.com (Alice Zhu [MSFT]) 26.09.2006 10:03:18
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.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net