Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - New line in stead of new paragraph

Reply
 
Old 10-28-2008   #1 (permalink)
Wendy


 
 

New line in stead of new paragraph

I use VBscript to make a Signature in Outlook with the values of the Active
directory.

In outlook 2003 the sentences are on the next line. In Outlook 2007 all new
sentences are treated like new paragraphs. The normal.dotm is all ready
changed to get to the next line if pressed enter.

How can I change this behavior?


My System SpecsSystem Spec
Old 10-28-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: New line in stead of new paragraph


"Wendy" <Wendy@xxxxxx> wrote in message
news:E688A314-8927-4CD8-B742-882DFF304DE1@xxxxxx
Quote:

>I use VBscript to make a Signature in Outlook with the values of the Active
> directory.
>
> In outlook 2003 the sentences are on the next line. In Outlook 2007 all
> new
> sentences are treated like new paragraphs. The normal.dotm is all ready
> changed to get to the next line if pressed enter.
>
> How can I change this behavior?
>
Let's have a look at your script.


My System SpecsSystem Spec
Old 10-28-2008   #3 (permalink)
Wendy


 
 

Re: New line in stead of new paragraph

> Let's have a look at your script.
Quote:

>
This is the script

Between the Title and the Company name i use the "& vbCrLf" option for the
next line. But it stil behaves as a paragraph.

=====
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
strl = objUser.l
strst = objUser.st
strmail = objUser.mail
strwWWHomePage = objUser.wWWHomePage


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 = "Verdana"
objSelection.Font.Size = "10"

objSelection.TypeText "Kind Regards,"
objSelection.TypeParagraph()

objSelection.TypeText strName
objSelection.TypeParagraph()

objSelection.Font.Size = "10"

objSelection.TypeText strTitle & vbCrLf
objSelection.TypeText strCompany
objSelection.TypeParagraph()

objSelection.Font.Size = "7,5"

objSelection.TypeText "Tel.: "
objSelection.TypeText strPhone & vbCrLf
objSelection.TypeText strmail & vbCrLf
objSelection.TypeText strwWWHomePage
objSelection.TypeParagraph()

objSelection.TypeText "disclaimer: "

Set objSelection = objDoc.Range()

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

objDoc.Saved = True
objWord.Quit


My System SpecsSystem Spec
Old 10-28-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: New line in stead of new paragraph


"Wendy" <Wendy@xxxxxx> wrote in message
news:9A13BE5D-0BBA-4CA5-B813-6D130CD467DE@xxxxxx
Quote:
Quote:

>> Let's have a look at your script.
>>
> This is the script
>
> Between the Title and the Company name i use the "& vbCrLf" option for
> the
> next line. But it stil behaves as a paragraph.
>
> =====
> 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
> strl = objUser.l
> strst = objUser.st
> strmail = objUser.mail
> strwWWHomePage = objUser.wWWHomePage
>
>
> 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 = "Verdana"
> objSelection.Font.Size = "10"
>
> objSelection.TypeText "Kind Regards,"
> objSelection.TypeParagraph()
>
> objSelection.TypeText strName
> objSelection.TypeParagraph()
>
> objSelection.Font.Size = "10"
>
> objSelection.TypeText strTitle & vbCrLf
> objSelection.TypeText strCompany
> objSelection.TypeParagraph()
>
> objSelection.Font.Size = "7,5"
>
> objSelection.TypeText "Tel.: "
> objSelection.TypeText strPhone & vbCrLf
> objSelection.TypeText strmail & vbCrLf
> objSelection.TypeText strwWWHomePage
> objSelection.TypeParagraph()
>
> objSelection.TypeText "disclaimer: "
>
> Set objSelection = objDoc.Range()
>
> objSignatureEntries.Add "AD Signature", objSelection
> objSignatureObject.NewMessageSignature = "AD Signature"
> objSignatureObject.ReplyMessageSignature = "AD Signature"
>
> objDoc.Saved = True
> objWord.Quit
VB Script provides you with three constants in this context:
vbCRLF (carriage return & line feed, also called "paragraph marker")
vbLF (line feed, i.e. start a new line)
vbCR (carriage return, i.e. return to the start of the line)

I suggest you use vbLF instead of vbCRLF.


My System SpecsSystem Spec
Old 10-28-2008   #5 (permalink)
Al Dunbar


 
 

Re: New line in stead of new paragraph


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:uSPjlmTOJHA.4404@xxxxxx
Quote:

>
> "Wendy" <Wendy@xxxxxx> wrote in message
> news:9A13BE5D-0BBA-4CA5-B813-6D130CD467DE@xxxxxx
Quote:
Quote:

>>> Let's have a look at your script.
>>>
>> This is the script
>>
>> Between the Title and the Company name i use the "& vbCrLf" option for
>> the
>> next line. But it stil behaves as a paragraph.
>>
>> =====
>> 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
>> strl = objUser.l
>> strst = objUser.st
>> strmail = objUser.mail
>> strwWWHomePage = objUser.wWWHomePage
>>
>>
>> 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 = "Verdana"
>> objSelection.Font.Size = "10"
>>
>> objSelection.TypeText "Kind Regards,"
>> objSelection.TypeParagraph()
>>
>> objSelection.TypeText strName
>> objSelection.TypeParagraph()
>>
>> objSelection.Font.Size = "10"
>>
>> objSelection.TypeText strTitle & vbCrLf
>> objSelection.TypeText strCompany
>> objSelection.TypeParagraph()
>>
>> objSelection.Font.Size = "7,5"
>>
>> objSelection.TypeText "Tel.: "
>> objSelection.TypeText strPhone & vbCrLf
>> objSelection.TypeText strmail & vbCrLf
>> objSelection.TypeText strwWWHomePage
>> objSelection.TypeParagraph()
>>
>> objSelection.TypeText "disclaimer: "
>>
>> Set objSelection = objDoc.Range()
>>
>> objSignatureEntries.Add "AD Signature", objSelection
>> objSignatureObject.NewMessageSignature = "AD Signature"
>> objSignatureObject.ReplyMessageSignature = "AD Signature"
>>
>> objDoc.Saved = True
>> objWord.Quit
>
> VB Script provides you with three constants in this context:
FOUR
Quote:

> vbCRLF (carriage return & line feed, also called "paragraph marker")
> vbLF (line feed, i.e. start a new line)
> vbCR (carriage return, i.e. return to the start of the line)
vbNewline - defined to mean what the o/s considers an end of line indicator.
Quote:

>
> I suggest you use vbLF instead of vbCRLF.
Worth a try, but I'd suggest also trying vbNewline.

/Al


My System SpecsSystem Spec
Old 10-29-2008   #6 (permalink)
Wendy


 
 

Re: New line in stead of new paragraph

In combination with the option

objSelection.Style = "No Spacing"

did the trick

Tnx.


"Pegasus (MVP)" wrote:
Quote:

>
> "Wendy" <Wendy@xxxxxx> wrote in message
> news:9A13BE5D-0BBA-4CA5-B813-6D130CD467DE@xxxxxx
Quote:
Quote:

> >> Let's have a look at your script.
> >>
> > This is the script
> >
> > Between the Title and the Company name i use the "& vbCrLf" option for
> > the
> > next line. But it stil behaves as a paragraph.
> >
> > =====
> > 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
> > strl = objUser.l
> > strst = objUser.st
> > strmail = objUser.mail
> > strwWWHomePage = objUser.wWWHomePage
> >
> >
> > 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 = "Verdana"
> > objSelection.Font.Size = "10"
> >
> > objSelection.TypeText "Kind Regards,"
> > objSelection.TypeParagraph()
> >
> > objSelection.TypeText strName
> > objSelection.TypeParagraph()
> >
> > objSelection.Font.Size = "10"
> >
> > objSelection.TypeText strTitle & vbCrLf
> > objSelection.TypeText strCompany
> > objSelection.TypeParagraph()
> >
> > objSelection.Font.Size = "7,5"
> >
> > objSelection.TypeText "Tel.: "
> > objSelection.TypeText strPhone & vbCrLf
> > objSelection.TypeText strmail & vbCrLf
> > objSelection.TypeText strwWWHomePage
> > objSelection.TypeParagraph()
> >
> > objSelection.TypeText "disclaimer: "
> >
> > Set objSelection = objDoc.Range()
> >
> > objSignatureEntries.Add "AD Signature", objSelection
> > objSignatureObject.NewMessageSignature = "AD Signature"
> > objSignatureObject.ReplyMessageSignature = "AD Signature"
> >
> > objDoc.Saved = True
> > objWord.Quit
>
> VB Script provides you with three constants in this context:
> vbCRLF (carriage return & line feed, also called "paragraph marker")
> vbLF (line feed, i.e. start a new line)
> vbCR (carriage return, i.e. return to the start of the line)
>
> I suggest you use vbLF instead of vbCRLF.
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Line spacing (paragraph separation) fails sometimes Live Mail
Getting Word Paragraph Number VB Script
large E in stead of question mark Vista mail
When I type the words skip to previous paragraph Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46