Hi Jean-Guy
I have made the changes you suggested but although there is only one
document open, there are still 2 prompts to save, 1 for the .doc and 1 for
the .dot.
I am happy with the way the rest xof the script is working and I am not to
worried about the prompts so thanks you very much for your help.
Kind regards
Malcolm
"Jean-Guy Marcil" wrote:
> "malycom" wrote:
>
> > Jean-Guy
> >
> > Thank you very much. That works a treat.
> >
> > Now, if you can answer one last final question I will name a planet after
> > you....or at least be very greatful.
> >
> > Although the Document 1 form closes and the user is left with only the
> > merged document which is fantastic, there are still 2 save prompts. One for
> > the merged document and one for the template. It doesn't make any difference
> > whether they save the template or not as it is not affected, but is there a
> > way to do away with the prompt to save the template.
>
> Try this instead:
>
> Sub AutoNew()
>
> Dim doctemp As Document
>
> Set doctemp = ActiveDocument
>
> With doctemp
> With .MailMerge
> .MainDocumentType = wdFormLetters
> .OpenDataSource Name:= _
> "C:\ENTMRG.DBF", ConfirmConversions:=False
> .Destination = wdSendToNewDocument
> .SuppressBlankLines = True
> With .DataSource
> .FirstRecord = wdDefaultFirstRecord
> .LastRecord = wdDefaultLastRecord
> End With
> .Execute
> End With
> ThisDocument.Saved = True
> .Close wdDoNotSaveChanges
> End With
>
> End Sub
>