• Activating Word from Access mail merge (2000 (all?

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Activating Word from Access mail merge (2000 (all?

    Author
    Topic
    #412110

    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?

    Viewing 5 reply threads
    Author
    Replies
    • #898490

      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

    • #898491

      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

    • #898492

      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??!

    • #898493

      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??!

    • #898903

      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.

    • #898904

      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.

    Viewing 5 reply threads
    Reply To: Activating Word from Access mail merge (2000 (all?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: