Results 1 to 9 of 9

Thread: Merge field syntax problem

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Merge field syntax problem

    I am trying to insert a mail-merge field and I can't find the correct syntax.

    This is what I've got so far and it doesn't work.

    Code:
        With wrdDoc
    .Content.InsertAfter Format(MyDate, "dddd, d MMMM yyyy")
        .Content.InsertParagraphAfter
        .Content.InsertAfter "Dear "
        End With
    
            ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldMergeField _
            , Text:=" MERGEFIELD First"
    (The code works up to the "End with", it's the next line that is the problem.)

    I would be very grateful if someone knows the correct syntax. I've tried some other versions of this, also unsuccessfully.
    Last edited by Resource Dragon; Nov 26th, 2011 at 07:50 AM. Reason: Aim for additional clarity.

Posting Permissions

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



Click Here to Expand Forum to Full Width