Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Oct 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Merge field should contain line breaks

    Hi,
    I have a mail merge field that contains the addresses for a branch. This field contains line breaks as the address consists of multiple rows.
    I have automated the mail merge in a c# webservice.
    My datasource is a tab delimited text file. If I use \n and\or \r in the field the opendatasource method gives an exception.
    I have also tried, " " as well as "

", but this is just displayed as plain text in the resultant word document.
    Kind regards

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Unless the line breaks are physically present in the data, nothing you can do will cause the mailmerge to add them. With text files, that's impossible, AFAIK. Preferably, you should have separate, tab-delimited, fields for each component of the address. That way, you can have the line breaks (including conditional ones) in the mailmerge main document itself, as discussed in my Word Mailmerge Tips & Tricks 'Sticky' thread at the top of this forum: http://windowssecrets.com/forums/sho...ips-amp-Tricks
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Tags for this Thread

Posting Permissions

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