J
John Piwko
I have a very large report - 300+ pieces of data to insert
into it. So, I cannot use just one table or query with
which to create the merge document. I have created the two
merge documents and they work well. What I want to do is
to have the two merge documents combine, print out, be
saved as one large Word document and then delete the two
smaller documents....all from within access..........any
ideas? I will post the code that creates and saves the two
smaller documents.
Dim HRName As String
Dim HUDa As String
Dim HUDb As String
HRName = strRPID (This is defined above this section of
code)
Dim objWord As Word.Application, o_doc As Word.Document
strFilePath1 = "c:\db\HUDANNUAL1.doc" (This is a word
merge document)
Set objWord = New Word.Application
Set o_doc = objWord.Documents.Add(strFilePath1)
objWord.Visible = False
o_doc.MailMerge.MainDocumentType = wdNotAMergeDocument
objWord.ChangeFileOpenDirectory "c:\db\HR"
HUDa = CStr(HRName) & "a.doc"
o_doc.SaveAs FileName:=CStr(HRName) & "a.doc"
o_doc.Close SaveChanges:=wdDoNotSaveChanges
strFilePath2 = "c:\db\HUDANNUAL2.doc" (This is a Word
merge document)
Set objWord = New Word.Application
Set o_doc = objWord.Documents.Add(strFilePath2)
objWord.Visible = False
o_doc.MailMerge.MainDocumentType = wdNotAMergeDocument
objWord.ChangeFileOpenDirectory "c:\db\HR"
HUDb = CStr(HRName) & "B.doc"
o_doc.SaveAs FileName:=CStr(HRName) & "b.doc"
o_doc.Close SaveChanges:=wdDoNotSaveChanges
'Here I would like to open HUDa, insert HUDb into it and
'then save that combined document as CStr(HRName) & ".doc"
'and then delete HUDa & HUDb because I no longer need them
objWord.ChangeFileOpenDirectory "c:\Documents and
Settings\Administrator\My Documents"
objWord.Quit
Set o_doc = Nothing
Set objWord = Nothing
Any and all ideas appreciated
into it. So, I cannot use just one table or query with
which to create the merge document. I have created the two
merge documents and they work well. What I want to do is
to have the two merge documents combine, print out, be
saved as one large Word document and then delete the two
smaller documents....all from within access..........any
ideas? I will post the code that creates and saves the two
smaller documents.
Dim HRName As String
Dim HUDa As String
Dim HUDb As String
HRName = strRPID (This is defined above this section of
code)
Dim objWord As Word.Application, o_doc As Word.Document
strFilePath1 = "c:\db\HUDANNUAL1.doc" (This is a word
merge document)
Set objWord = New Word.Application
Set o_doc = objWord.Documents.Add(strFilePath1)
objWord.Visible = False
o_doc.MailMerge.MainDocumentType = wdNotAMergeDocument
objWord.ChangeFileOpenDirectory "c:\db\HR"
HUDa = CStr(HRName) & "a.doc"
o_doc.SaveAs FileName:=CStr(HRName) & "a.doc"
o_doc.Close SaveChanges:=wdDoNotSaveChanges
strFilePath2 = "c:\db\HUDANNUAL2.doc" (This is a Word
merge document)
Set objWord = New Word.Application
Set o_doc = objWord.Documents.Add(strFilePath2)
objWord.Visible = False
o_doc.MailMerge.MainDocumentType = wdNotAMergeDocument
objWord.ChangeFileOpenDirectory "c:\db\HR"
HUDb = CStr(HRName) & "B.doc"
o_doc.SaveAs FileName:=CStr(HRName) & "b.doc"
o_doc.Close SaveChanges:=wdDoNotSaveChanges
'Here I would like to open HUDa, insert HUDb into it and
'then save that combined document as CStr(HRName) & ".doc"
'and then delete HUDa & HUDb because I no longer need them
objWord.ChangeFileOpenDirectory "c:\Documents and
Settings\Administrator\My Documents"
objWord.Quit
Set o_doc = Nothing
Set objWord = Nothing
Any and all ideas appreciated