Re: Line Spacing

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Those lines give me the carriage return. If I do not have them, everything
flows on one line. Also, they will put an extra blank line when I need one.

In Active directory, the "streetaddress" is entered in the user account as
follows:

1111 Sand Ave, Suite 100
City, State Zip

When that attribute is pulled from AD, and placed in the word doc, it
appears:

1111 Sand Ave, Suite 100

City, State Zip

This "double spacing" I think is a function of Word 2007 and I would just
like to force single spacing.

Thanks Richard.
"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:usWR2xeiIHA.6136@xxxxxxxxxxxxxxxxxxxxxxx
What happens when you remove the lines:

objSelection.TypeText CHR(11)

Most likely, the TypeText method inserts carriage control characters. The
character Chr(11) is just the Home key, I believe.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--

"Michael" <support@xxxxxxxxxxxxx> wrote in message
news:u%23amxdeiIHA.4740@xxxxxxxxxxxxxxxxxxxxxxx
Here is my code. Please understand I have removed some distinguishing
network info, but for the most part, it is intact.

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

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

strName = objUser.FullName
strTitle = objUser.Title
strCompany = objUser.Company
strPhone = objUser.telephoneNumber
strEmail = objUser.mail
strPOBox = objUser.PostOfficeBox
strCity = objUser.l
strState = objUser.St
strZip = objUser.postalcode
strStreet = objUser.streetaddress




Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

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

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.Font.Name = "Americana BT"
objSelection.Font.Size = "11"
objSelection.Font.Color = vbBlue
objSelection.Font.Bold = True
objSelection.TypeText strName
objSelection.TypeText CHR(11)
objSelection.Font.Color = vbBlack
objSelection.Font.Bold = False
objSelection.TypeText strTitle
objSelection.TypeText CHR(11)
objSelection.Hyperlinks.Add objSelection.range, "mailto:"; & strEmail, , ,
strEmail
objSelection.TypeParagraph()
objSelection.InlineShapes.AddPicture(strLogo)
objSelection.TypeText CHR(11)
objSelection.Font.Bold = True
objSelection.TypeText strCompany
objSelection.TypeText CHR(11)
objSelection.Font.Bold = False
objSelection.TypeText "PO Box" & " " & strPOBox
objSelection.TypeText CHR(11)
objSelection.TypeText strCity & ", " & strState & " " & strZip
objSelection.TypeText CHR(11)
objSelection.TypeText CHR(11)
objSelection.TypeText strStreet
objSelection.TypeText CHR(11)
objSelection.TypeText strPhone
objSelection.TypeText CHR(11)
objSelection.Font.Italic = True
objSelection.Font.Color = vbRed
objSelection.Font.Bold = True
objSelection.Font.Italic = False
objSelection.TypeText CHR(11)
objSelection.Font.Name = "Calibri"
objSelection.Font.Size = "8"
objSelection.TypeText "PERSONAL AND CONFIDENTIAL"
objSelection.Font.Color = vbBlack
objSelection.TypeText ": "
objSelection.Font.Bold = False


Set objSelection = objDoc.Range()

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

objDoc.Saved = True
objWord.Quit
"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message
news:%23eDpEaeiIHA.6092@xxxxxxxxxxxxxxxxxxxxxxx

"Michael" <support@xxxxxxxxxxxxx> wrote in message
news:OtlyZJeiIHA.5152@xxxxxxxxxxxxxxxxxxxxxxx
I have a vbscript reading active directory attributes to create an email
signature. When the "streetaddress" is pulled in, it double spaces the
lines, even though the "streetaddress" is not double spaced. Is there a
code for single line spacing i can place before the street address to
force single space?

Thanks,

Michael


Let's have a look at your code.







.



Relevant Pages

  • Re: Line Spacing
    ... the TypeText method inserts carriage control characters. ... Set objSelection = objWord.Selection ... objSignatureObject.NewMessageSignature = "AD Signature" ... even though the "streetaddress" is not double spaced. ...
    (microsoft.public.scripting.vbscript)
  • Re: Line Spacing
    ... Set objSelection = objWord.Selection ... objSignatureObject.NewMessageSignature = "AD Signature" ... even though the "streetaddress" is not double spaced. ...
    (microsoft.public.scripting.vbscript)
  • Re: Line Spacing
    ... hard-coded strings in the string definitions up the top. ... the "streetaddress" is entered in the user account as ... like to force single spacing. ... objSignatureObject.NewMessageSignature = "AD Signature" ...
    (microsoft.public.scripting.vbscript)
  • Re: Sendkeys Timing
    ... I don't remember why I was using a linefeed and not a carriage ... I tried the DoEvents and changing the False to a True in the sendkeys ... the Access DoMenuItem command that I could use to access the Signature file ... >> I then want a gap between the heading and the signature line, ...
    (microsoft.public.outlook.program_vba)
  • New E-Mail Template Format Issue Word 2002 (XP)
    ... signature appears correctly, yet there are two carriage returns prior to the ... The carriage returns are OK - but they are double spaced. ... I have tried everything from trying to modify Styles and templates, ...
    (microsoft.public.word.pagelayout)