Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 2 Mar 2006 07:27:41 -0800,    group: microsoft.public.word.vba.customization        back       


mail merge causes word problem   
I am running a mail merge from vb6 using Word 2003. My code produces the mail 
merge documents like expected. When Word is opened though, on the left panel 
it lists all the merge documents as recoverable documents. Why is this? 

This is my closing code from VB6

    FillBreederReg wrdDataDoc, iRow, lname, SSN, lname, Address1, city, 
State, zip, Phone, strAssoc1, strAssoc2, strAssoc3, strAssoc4
    wrdDataDoc.Save   'this is required here for word 2003 else you will get 
error  5631 (kb article 828388)
    wrdDataDoc.Close False

    'merge the information
    wrdMailMerge.Destination = wdSendToNewDocument
    wrdMailMerge.Execute False
    wrdApp.Options.PrintBackground = False
    wrdApp.ActiveDocument.PrintOut
    wrdApp.ActiveDocument.Close False

    'close the original files
    wrdDoc.Saved = True
    wrdDoc.Close False

' This seemed to be necessary in prior versions of Word like 2000)
'    wrdDoc.ActiveWindow.Close False  
'    wrdApp.Quit
    
    Set wrdSelection = Nothing
    Set wrdMailMerge = Nothing
    Set wrdMergeFields = Nothing
    Set wrdDataDoc = Nothing
    Set wrdDoc = Nothing
    Set wrdApp = Nothing

Any help on this would be appreciated.
date: Thu, 2 Mar 2006 07:27:41 -0800   author:   sparty1022

Re: mail merge causes word problem   
> ' This seemed to be necessary in prior versions of Word like 2000)
> '    wrdDoc.ActiveWindow.Close False
> '    wrdApp.Quit

These two are always necessary I think.

Oliver Townshend
date: Sun, 5 Mar 2006 22:50:08 +1100   author:   Oliver Townshend oliveratzipdotcomdotau

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us