vbcrlf 
Author Message
 vbcrlf

Hi there,

I'm trying to create a little program for word that allows me to type in
certain variables and then spit out a letter to my customer.

I need to know how to create a line break in VBA, it has been a few years
since i tried anything in vba, and I'm having trouble jogging my memory.

Here is an example of what I am trying to do...

ThisDocument.Content = "Hello," & txtName.Text & vbCrLf
& "How are you today?" & vbCrLf
& "Bye bye!"

This is what I want it to look like:

Hello, Mr. Jones
How are you today?
Bye Bye

I keep getting errors on my attempted line breaks though (vbCrLf). I can't
remember what I am doing wrong and I know it's something simple and stupid,
please help!

Thanks,

--
Will Mowat - Near North Web Services

http://www.*-*-*.com/



Fri, 14 Oct 2005 19:05:59 GMT  
 vbcrlf
Hi Will,

Just use vbCr.  The linefeed is automatic.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> Hi there,

> I'm trying to create a little program for word that allows me to type in
> certain variables and then spit out a letter to my customer.

> I need to know how to create a line break in VBA, it has been a few years
> since i tried anything in vba, and I'm having trouble jogging my memory.

> Here is an example of what I am trying to do...

> ThisDocument.Content = "Hello," & txtName.Text & vbCrLf
> & "How are you today?" & vbCrLf
> & "Bye bye!"

> This is what I want it to look like:

> Hello, Mr. Jones
> How are you today?
> Bye Bye

> I keep getting errors on my attempted line breaks though (vbCrLf). I can't
> remember what I am doing wrong and I know it's something simple and
stupid,
> please help!

> Thanks,

> --
> Will Mowat - Near North Web Services

> http://www.nearnorthweb.com



Fri, 14 Oct 2005 18:41:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. vbcrlf or vbCrLf

2. vbCrLf after attachment - (not '.Body')

3. vbCrLf - what is it?

4. vbcrlf

5. Embedded vbLF in message body is converted to vbCRLf

6. Squares using vbCrLf or Chr(13)

7. Stripping vbCrLf from strings

8. problem adding vbCrLf to FormField

9. When vbCr and when vbCrLf?

10. Word XP Unprintable vbCrLF

11. Splitting on vbCRLF

12. vbCrLf in VB6

 

 
Powered by phpBB® Forum Software