Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail merge envelopes using bookmarks (97)

    I am trying to see how I can get a simple mail merge to work using bookmarks. Some of my address blocks in our letters use some extensive "If, then; FILLIN" fields. So, what I am trying to do is simply add an envelope to a standard mail merge letter in word. I thought I could set it up using a SET (bookmark) so that whatever I add using the if then statement in the actual letter, it populates in the envelope. However I am lost. Maybe I just don't know how to use bookmarks properly. Here is what I have been doing & my result is: the letter doesn't show the address block & the envelope is blank also. I am not sure if I should be using REF or what. Can anyone help out?

    {SETaddress1 ""} {MERGEFIELD Reference Name}
    [MERGEFIELD REFERNCE ADDRESS} {IF {MERGEFIELD REFERENCE ADDRESS} = ":22 S Greene Street" {FILLIN "what is the room number for this reference?" ""}
    {MERGFIELD REFERENCE CITY}, {MERGEFIELD REFERENCE STATE} {MERGEFIELD REFERENCE ZIP}

    then on the envelope I entered {REF address1}

    Like I said I am getting prompted I belive for the fillin twice, but then the letter & the envelope are not the same or working out. Thanks for any help!

  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

    Re: Mail merge envelopes using bookmarks (97)

    Hi blansing,

    There's something seriously wrong with your mergefields! I suspect you've been adding 'REFERENCE' to them.

    What you need for the main part of your document appears to be:
    {MERGEFIELD Name}
    {MERGEFIELD ADDRESS}{IF {MERGEFIELD ADDRESS} = ":22 S Greene Street" {FILLIN "what is the room number for this reference?"} ""}
    {MERGFIELD CITY}, {MERGEFIELD STATE} {MERGEFIELD ZIP}
    So that you can use the room number data elsewhere, I'd suggest changing the IF test to:
    {IF{MERGEFIELD ADDRESS}= ":22 S Greene Street" "{ASK Room "What is the Room Number for this reference?"}, Room Number {REF Room}" ""}

    For your envelope, you'd then use:
    {MERGEFIELD Name}
    {MERGEFIELD ADDRESS}{IF {MERGEFIELD ADDRESS} = ":22 S Greene Street" ", Room Number {REF Room}" ""}
    {MERGFIELD CITY}, {MERGEFIELD STATE} {MERGEFIELD ZIP}
    In this case, the only bookmark that's been needed is the 'Room' bookmark created by the ASK field.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Macropod:

    Thanks. The field name is for a doctor's "reference". We send out letters to the doctor's refernce assking them to complete our evaluation form. Our database has already named the fields, this is the reason each of the fields had Refernce included in it. Do you think this is what could throwing word off?

    Also what if I wanted to simply have whatever someone typed at the address block automatically show up on the envelope?
    Thanks again,
    Brad Lansinger
    blansinger@umm.edu

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Hi Brad:
    Macropod's not online right now. If "Reference" is part of your field name, then it shouldn't be causing a problem. It seems to me that your {SET} field isn't doing anything useful. You set a bookmark to have no text. Later, you reference that bookmark, but it isn't populated. That's why nothing shows up. I'd suggest using Macropod's fields & syntax, but where he has {MERGEFIELD Name}, you would have {MERGEFIELD Reference Name}, etc.

    By the way, although Word will handle field names with spaces, I've always found it best to have a name like "ReferenceName", rather than "Reference Name".
    Cheers,

  5. #5
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Thanks I apreciate that info.

    The info that Macropod gave in his post did help to get the one letter working fine. However I have several letters that the address portion of the letter contains complex field statements that I am not sure how to include in the "SET" field. The following is just the address block form one our more complex letters:

    Chairman, Department of { MERGEFIELD AFFILIATION_TYPE }
    { MERGEFIELD AFFILIATION_NAME }
    { IF { MERGEFIELD AFFILIATION_NAME } = "University of MD Medical System" "{ FILLIN "Please enter department and room number of recipient." d "{ MERGEFIELD AFFILIATION_ADDRESS_1 } { MERGEFIELD AFFILIATION_ADDRESS_2 } " }" "{ MERGEFIELD AFFILIATION_ADDRESS_1 } { MERGEFIELD AFFILIATION_ADDRESS_2 }" }
    { MERGEFIELD AFFILIATION_CITY }, { MERGEFIELD AFFILIATION_STATE } { MERGEFIELD AFFILIATION_ZIP }
    { IF { USERNAME * MERGEFORMAT } = "Bradley Lansinger, CPCS" "{ FILLIN "Is there a contact listed for { MERGEFIELD AFFILIATION_NAME }, { MERGEFIELD AFFILIATION_DATE_FROM }-{ MERGEFIELD AFFILIATION_DATE_THRU } that this letter should be addressed to?" }}

    Is there a way to simply have whatever the result of this complex statement returns to populate the on the envelope? This is really all I want. My office has been using these letters for years without a problem & now we have decided to attach envelopes to them. I though I could do this with a simple bookmark, and then simply add the name of the book mark to the envelope. This would make my life alot easier. But this is not working out.

    Can anyone help? I am a bit new as you can tell with using the {SET} & {REF} fields in documents

    Thanks,
    Brad
    Blansinger@umm.edu

    PS I attachhed the actual letter if that helps.

  6. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Hi Brad,

    The document attached to your latest post doesn't appear to have the latest set of field's you're wanting help with.

    Even so, there may be a (moderately) simple solution:
    . Select the whole of the address block from one your more complex letters and press Ctrl-F9.
    This will wrap the whole address block inside another field.
    . Type '<font color=red>SET AddrBlock "</font color=red>' just inside the left-most field brace (ie {<font color=red>SET AddrBlock "</font color=red>Chairman, ) and '<font color=red>"</font color=red>' just inside the right-most field brace (ie addressed to?" }}<font color=red>"</font color=red>}) so that you convert
    { Chairman, .... addressed to?" }} }
    into:
    {<font color=red>SET AddrBlock "</font color=red>Chairman, .... addressed to?" }}<font color=red>"</font color=red>}.
    This will create an 'AddrBlock' bookmark for the address block .
    . Cut the whole of the new field out of the document.
    . Go the the very start of the document and paste the old field in.
    This is to ensure that the 'AddrBlock' bookmark gets set before the REF fields you're about to create start looking for it.
    . Create a new field (via Ctrl-F9) where the old field used to be.
    . Type 'REF AddrBlock' inside the new field (ie {<font color=red>REF AddrBlock</font color=red>}).
    This will replicate the address block where the old one used to appear.
    . Copy the 'REF AddrBlock' field and paste it onto your envelope form.
    This will replicate the address block on the envelope also.

    Repeat the above for each of your mailmerge documents.

    Cheers
    PS: I'm glad to see that 'REFERENCE' wasn't an error in the coding referred to in your original post. I hope I didn't cause to too much worry over that.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. #7
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Macropod:

    You are right, this letter is a different letter than what I started asking about. I figired if I could get someone to help me I should try to get help with the most difficult letters I have.

    Thank you very much (I have been banging my head into a wall for days trying to figure this out). This seems to help get the address in both places I wanted it to (the envelope & the address block).

    However for the ASK field I have set up in the document, it seems to be asking me twice to enter this information for the same record when I merge them. Any idea of why this may happening? Here is what I did...

    { SET AddrBlock "Chairman, Department of { MERGEFIELD AFFILIATION_TYPE }
    { MERGEFIELD AFFILIATION_NAME }
    { IF { MERGEFIELD AFFILIATION_NAME } = "University of MD Medical System" "{ FILLIN "Please enter department and room number of recipient." d "{ MERGEFIELD AFFILIATION_ADDRESS_1 } { MERGEFIELD AFFILIATION_ADDRESS_2 } " }" "{ MERGEFIELD AFFILIATION_ADDRESS_1 } { MERGEFIELD AFFILIATION_ADDRESS_2 }" }
    { MERGEFIELD AFFILIATION_CITY }, { MERGEFIELD AFFILIATION_STATE } { MERGEFIELD AFFILIATION_ZIP }
    { IF { USERNAME * MERGEFORMAT } = "Bradley Lansinger, CPCS" "{ FILLIN "Is there a contact listed for { MERGEFIELD AFFILIATION_NAME }, { MERGEFIELD AFFILIATION_DATE_FROM }-{ MERGEFIELD AFFILIATION_DATE_THRU } that this letter should be addressed to?" }}" }


    Also I attached the document for you to look at. I really , really, really appreciate your assistance withese letters!!! <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    Thanks Brad

    Blansinger@umm.edu
    Attached Files Attached Files

  8. #8
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Macropod, just another note about this dredded letter, it seems to be asking me to enter this info twice because I added the bookmark at the top of the page. I tried to test the "ask's" and when I entered (IE '1') for the first time the ask came up it didn't show up anywhere in my document. However on the second go round when it asked the same questions , I entered '2'. Odd enough that is the one showing up in the {REF} on the envelope & where the addressblock should be.

    Just thought I would let you know that too.

    Thanks Brad

  9. #9
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Hi Brad,

    The double-prompting is a result of having the FILLIN field you'd used embedded in the SET field. The attached revised coding, which uses ASK fields outside the SET field and REF fields inside the SET field instead, resolves those issues.

    It is important to note that the technique I've employed also relies creating the 'Dept' and 'Contact' bookmarks for the SET fields before saving the document. I did this by placing the insertion point immediatley before the first field (note the new layout) and using Insert|Bookmark. Without that, you'd likely see 'Error. Bookmark not defined!' populating your output.

    Cheers
    Attached Files Attached Files
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  10. #10
    New Lounger
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Hey Macropod (or Anyone else knowledgeable about Mail merging to enveloeps):

    Everytime I use the code you exampled for me in the previous letter I am getting the address block set incorrectly for USA mailings. Our standard would be:
    Name
    Addr1 Addr2
    City, State Zip

    The AddrBlock you set up in the document for some reason makes the address block look like:
    Name addr1
    addr2
    city, state zip

    I have tried going through the bookmark set at the top of the envelope using the "lP"paragrah symbol turned on to see if I can try to straighten it out & I then get completely lost trying to read through the code. Do you think you could tak another look at this. I attached the document that it is doing it in..

    With Regards,
    Attached Files Attached Files

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge envelopes using bookmarks (97)

    While I haven't followed the entire thread, I think you're simply missing a paragraph mark. See the attached document, where I put the paragraph mark in red (you can change it).
    Hope this helps,
    Attached Files Attached Files

  12. #12
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Mail merge envelopes using bookmarks (97)

    Hi Brad,

    Update attached. In addition to adjusting the field layout to put the address on a new line, I added some code to put the department name & room number on a separate line also. If you don't need/want that, replace:
    {IF{Dept}="" "" "{Dept}
    "}
    with
    {Dept}
    and a trailing space.

    BTW, your original (and revised) coding for the first ASK field, which I had previously maintained, would only ensure the Addr1 and Addr2 results were output if the ASK field wasn't triggered. Although they were embedded in the ASK field's results, they could easily have been deleted. I've re-coded the fields to output the Addr1 and Addr2 results regardless.

    Finally, I've used a Charformat switch on both AddrBlock REF fields to control the output fonts. Typically, Postal services prefer Arial/Helvetica, but you would probably want TNR in the body of your letter for consistency with the rest of the text. Using the Charformat switch with different AddrBlock REF field character formatting ensures both.

    Cheers
    Attached Files Attached Files
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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