Live Chat & Podcast Sunday at 12:00PM Eastern!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Tag Cloud
acer audio bios boot bsod compaq computer connection crash dell driver drivers dvd error excel firefox freeze game hard disk hard drive hardware hijackthis internet laptop linksys macro malware network outlook outlook 2003 outlook 2007 password problem recovery redirect server slow trojan upgrade usb video virus vista windows windows 7 windows vista windowsxp windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Word to outlook font problem

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Gudzy's Avatar
Member with 41 posts.
 
Join Date: Jan 2009
Experience: Beginner
09-Jun-2009, 05:13 AM #1
Solved: Word to outlook font problem
I've written a vbscript which takes some information from active directory and generates an email signature in outlook.

It works by making the signauture in word and then creating it in outlook.

I am creating an email signature by extracting details from active directory

The problem I am having is when I create the sig in word and specify the font as arial it goes to calibra (body) in outlook.

I have arial as my default font in word, if I change it to not be the default then it works in outlook, so I think outlook is just seeing arial as default and then using its own default, which is calibra.

So, can I change the default font in outlook to arial or is there another fix?

The code I am using:

Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
' Grab some of the users details from AD
strFirstName = objUser.FirstName
strSurName = objUser.LastName
strTitle = objUser.Title
strCompany = objUser.Company
strPhone = objUser.telephoneNumber
strDirect = objUser.homeNumber
strEmail = objUser.mail'
' Create MS Word Document
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
' Start Text area selection & choose email signature options
Set objSelection = objWord.Selection
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
' Setup Font and type style & Include variables from AD
objSelection.Font.Name = "Arial"
objSelection.Font.Size = 8
objSelection.Font.Bold = 1
objSelection.TypeText strFirstName & " " & strSurName & vbCrLf
objSelection.TypeText strTitle
objSelection.TypeParagraph()
objSelection.Font.Bold = 0
objSelection.TypeText "Tel: " & strPhone
objSelection.TypeParagraph()
objSelection.TypeText "Direct Dial: " & strFax
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText "Email: " & strEmail

Set objSelection = objDoc.Range()

' Update Outlook with the new signature and set as default
objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"
objDoc.Saved = True
objWord.quit

I also have a problem that word 2007 is using normal spacing and I need to have no spacing in the signature.

Edit:

Solved the spacing by adding objSelection.Style = "No Spacing"
I also moved the font declaration to after Set objSelection = objDoc.Range() which add some hyperlinks I added the correct font and size aswell as all the rest.

Last edited by Gudzy : 09-Jun-2009 07:49 AM.
Closed Thread Bookmark and Share   techguy.org/833835

Tags
active directory, font, outlook, word

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 11:38 AM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.