Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
 
Posts: n/a
Default template appending to merged document

Hello all,

I have automated a mail merge using vb.net. Not very easy, but I've
finally got it working with one exception. When the merge executes,
the new merge document that get created a copy of the template document
(minus the fields) is appending to the end of the merged document. I
get the form letter that I want and a copy of the template which I
don't. This happens whether I have the mailmerge print right out
(wesendtoprint) or create a new document (wdprintnewdocument). I can't
figure out what might be causing it.

Following is a portion of my code:

LetterDoc =
DataApp.Documents.Open("G:\imaging\Yooper\Sys\Lett erGen_Letters\ACTLetters\"
& LetterList.SelectedItem, , , , , , , , , , False)

With LetterDoc
.MailMerge.MainDocumentType =
WdMailMergeMainDocType.wdFormLetters
.MailMerge.CreateDataSource(Name:=CurDir() &
"\datadoc.doc", _
HeaderRecord:="last_name,first_name,e_mail,id_numb er")
.MailMerge.EditDataSource()
DataApp.ActiveDocument.Tables.Item(1).Rows.Add()
End With

(I populate the table with relevent data here)

With LetterDoc
With .MailMerge
.Destination =
WdMailMergeDestination.wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
.Execute()
End With
End With

Again, this is working perfectly accept for the copy of the template
which appends to the end of my product. Any idea? Please let me know.

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge to New Document Template Association Al Mailmerge 2 June 2nd 05 09:11 AM
CPU Usage When Working with Templates you created KM1 Microsoft Word Help 3 May 21st 05 11:57 PM
Template selector for SharePoint document libraries Daniel Microsoft Word Help 1 April 23rd 05 03:40 PM
Corrupt fonts when printing a merged document Mark J Barefoot Mailmerge 3 March 20th 05 08:17 PM
How to add additional copies of template to document Jim Cant Mailmerge 3 February 22nd 05 12:29 AM


All times are GMT +1. The time now is 11:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"