Reply
 
Thread Tools Display Modes
  #1   Report Post  
Jack
 
Posts: n/a
Default Loosing data connection when automating merge

When automating the merge of a doc via VS.NET, I am loosing the data
connection with in the doc and thus getting erroneous results. Has anyone
seen this behavior or know where to point me?

Here is a simplified call to the doc:

Private Sub PrintReport()

Dim wordapp As ApplicationClass
Dim wordDoc As Document
wordapp = New ApplicationClass
Dim sPages As String
Dim sfullpath As String = "C:\Projects\TestWinApp\Output\in\test3.doc"
If File.Exists(sfullpath) Then File.Delete(sfullpath)

If File.Exists("C:\Projects\TestWinApp\newdoc.doc") Then
wordDoc =
wordapp.Documents.Open("C:\Projects\TestWinApp\new doc.doc")
wordDoc.MailEnvelope "MergeUpdate")
sPages =
wordDoc.Bookmarks.Item("Print").Range.ComputeStati stics(WdStatistic.wdStatisticPages)
wordDoc.PrintOut(background:=True, Range:=4,
outputfilename:=sfullpath, Pages:="1-" & sPages)
wordDoc.Close(True)
wordDoc = Nothing ' close doc
wordapp.Quit()
wordapp = Nothing ' close word
End If
lblMain.Text += "File complete"
End Sub
--
Jack Wooten
Application Developer
  #2   Report Post  
Jack
 
Posts: n/a
Default

Please ignore the "wordDoc.MailEnvelope 'MergeUpdate')" in the previous post.
This was the beginnings of a solution search that I forgot to delete from
the code.
Reply
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
Mail merge data source problem campwes Mailmerge 1 January 25th 05 07:16 PM
stripping commas from merge data Patrick Heilman Mailmerge 0 December 30th 04 04:09 AM
no DDE connection to open data for mail merge LH1844 Mailmerge 1 December 14th 04 10:23 AM
Mail merge error occurs when filtering Excel data source Dave Mailmerge 1 December 2nd 04 10:46 PM
Merge Data Source path Peter Jamieson Mailmerge 0 November 25th 04 07:15 PM


All times are GMT +1. The time now is 08:16 AM.

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"