Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard netgear network printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Word to outlook font problem

Reply  
Thread Tools
Gudzy's Avatar
Member with 43 posts.
 
Join Date: Jan 2009
Experience: Beginner
09-Jun-2009, 07: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 at 09:49 AM..
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:40 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.