Conditional New line

Posted on 2011-05-04
Last Modified: 2012-05-11
I want to create a document with docvariables that I will substitue from a MS Access database. One of them is Address2 which I want to put on a new line if it is not blank but if it is blank then I don't want to include it. How do I do that? e.g. in the example below I don't want to use address2
Question by:Rob4077
    LVL 9

    Accepted Solution

    One way to do this would be to include the Paragraph mark (or Newline character) in the data you stuff in from Access. You would then put all the DOCVARIABLEs one after another, and let the supplied data cause the elements to be on separate lines.

    Author Comment

    Thanks lwebber, that sounds like ti would work and since no other suggestions have come in I will assume it is the best solution. Appreciate your suggestion.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
    This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
    This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
    This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now