Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Sep 2007
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post

    Adding Paragraph Marks in VBA (English/Word 2003)

    Hello.
    My office has recently upgraded from Word 97 to Word 2003 and as a result, some of the macros are acting funny. Case in point - I have a rather complex form created with a User Box. The User than fills in some of the information in the User Box and it then copies that information to the form. In the User Box, Client Address, City, State and Zip are all separate. In the form, they are all in one box. The line of code I used is (after declaring string) is strClientAddress = txtCliAddress & vbCr & txtCity & ", " & txtProv & " " & txtPC. However, the paragraph mark is only showing up as a little box and not making a separate line.

    Does anyone know why its doing this?

    Thanking you in advance for all your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding Paragraph Marks in VBA (English/Word 2003)

    Can you tell us how you use strClientAddress?

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Paragraph Marks in VBA (English/Word 2003)

    Does using VBCrLf rectify the situation? I think this is the same as a paragraph mark in the document body.

    Alan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding Paragraph Marks in VBA (English/Word 2003)

    Word uses vbCr as paragraph mark, not vbCrLf.

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Paragraph Marks in VBA (English/Word 2003)

    So it does! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Alan

  6. #6
    Star Lounger
    Join Date
    Sep 2007
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post

    Re: Adding Paragraph Marks in VBA (English/Word 2003)

    I use the string to combine the address, city, province and postal code (that are all entered into separate boxes in the Dialog Box ) into one line and insert that one line into the form (a table in Word using the form fields and locking it). It turns out upon closer examination though that everytime the user hits enter while filling out the dialog box, Word substitutes the paragraph mark with a blank rectangle. I wish I could show you the box as it is quite basic, but on the user box, there are three text boxes that allow for the enter key to be used and that multiline is true. The code is also quite basic - just filling in the values from the user box. ActiveDocument.FormFields("Re").result=ucase(txtRe ). However if the data entered into the User Box is multiline (two lines separated with an enter), then instead of putting in a paragraph mark, it puts in a blank rectangle.

    Does this make any sense to you? Have you ever heard of this before and if so, how do I fix it?

    Thank you so much for your help.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Adding Paragraph Marks in VBA (English/Word 20

    This question seems to be duplicated in a new thread here: Transferring Information entered in a User Form (English/Word 2003). Please don't duplicate posts; it makes the conversation more difficult to follow when replies and follow-ups are split up in different places.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •