Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jun 2002
    Location
    Nottingham, Nottinghamshire, United Kingdom
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Activating Word from Access mail merge (2000 (all?

    I have code for mail merging a single record from Access into a template letter using properties, e.g. prps.Item("Whatever").Value = Whatever

    After the properties have been set I highlight the whole letter and update it (all this code runs from within an Access module):

    appWord.Selection.WholeStory
    appWord.Selection.Fields.Update

    What I then want to do is to remove the highlight and maximise Word to the front. I have been using this code but it still leaves Word minimised with the whole document selected:

    appWord.Visible = True
    appWord.Activate

    My questions are:

    1) What command would cancel the highlighting and move the cursor to the start of the letter?
    2) How can I maximise Word from within Access?

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

    Re: Activating Word from Access mail merge (2000 (all?

    1) To place the insertion point at the start of the document:

    appWord.Selection.HomeKey Unit:=wdStory

    2) To maximize the Word window:

    appWord.WindowState = wdWindowStateMaximize

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Activating Word from Access mail merge (2000 (all?

    1. AppWord.Selection.HomeKey Unit:=wdStory should take it to the beginning of the doc.
    2. Have you tried AppWord.WindowState = wdWindowStateMaximize (this is recorded from Word.) You may need to set a reference/variable to the Word application first.

    This is not tested...give it a try though??!
    Regards,
    Rudi

  4. #4
    3 Star Lounger
    Join Date
    Jun 2002
    Location
    Nottingham, Nottinghamshire, United Kingdom
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Activating Word from Access mail merge (2000 (

    Hans and Rudi

    Awesome as ever. Thanks.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Activating Word from Access mail merge (2000 (all?

    In addition to the suggestions by Hans and Rudi, you might want to browse through our Word Merge Tutorial - it has links to several useful references in addition to some technique ideas when doing merges using Access/Word Automation.
    Wendell

Posting Permissions

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