Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Victoria, BC
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Messages after Merge

    I am using the code below to merge and print renewals.

    Function MergeIt()

    Dim objWord As Word.Document
    'path of renewal document
    Set objWord = GetObject("c:MLSRenewal.doc", "Word.Document")
    objWord.Application.Visible = True
    'path of database
    objWord.MailMerge.OpenDataSource Name:="C:MLSmls.mdb", _
    LinkToSource:=True, Connection:="QUERY qryXngPermitLetter", _
    SQLStatement:="SELECT * FROM [qryXngPermitLetter]"
    objWord.MailMerge.Destination = wdSendToNewDocument
    objWord.MailMerge.Execute
    objWord.Application.Options.PrintBackground = False
    objWord.Application.ActiveDocument.PrintOut
    objWord.Application.Quit

    Problem is, 1) At the end I get messages asking if I want to save FormLetter 1....... and a message asking if I want to save changes to the renewal.doc.. Is there some changes I can make to eliminate these messages? Obvious novice.
    And 2) Word does not close, and this has to be done manually. Access97 and Word97

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Messages after Merge

    Dear Alpi,

    There are some good examples on Helen Feddema's site:

    http://www.helenfeddema.com/CodeSamples.htm

    I'm not sue they are applicable but its a start.

  3. #3
    New Lounger
    Join Date
    Jan 2001
    Location
    Victoria, BC
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Messages after Merge

    From the six there, I don't see any with merging... or am I missing others?[img]/w3timages/icons/dizzy.gif[/img]

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Messages after Merge

    You need to specifically close the documents with a wdDoNotSaveChanges argument to avoid the prompt. That may also allow your Word application to quit, since it will no longer have open document objects to keep it open.

    If you haven't already found them, there are <A target="_blank" HREF=http://download.microsoft.com/download/office2000dev/sample/2/WIN98/EN-US/OFFAUTMN.EXE>automation samples for Access 97 and 2000 </A> available on the Microsoft site.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Jan 2001
    Location
    Victoria, BC
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Messages after Merge

    Thanks! You're simply awesome!

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Messages after Merge

    [img]/w3timages/icons/blush.gif[/img][img]/w3timages/icons/blush.gif[/img]Thanks.
    Charlotte

Posting Permissions

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