Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail merge data source problem | Mailmerge | |||
stripping commas from merge data | Mailmerge | |||
no DDE connection to open data for mail merge | Mailmerge | |||
Mail merge error occurs when filtering Excel data source | Mailmerge | |||
Merge Data Source path | Mailmerge |