V
Virgil
Folks, I'm tearing my hair out trying to find out WHY this
VBA code doesn't merge data into a Word 2003 template! The
code is used in an Access 2000/2002/2003 database. The
variables are fine, and the code works fine in Access 2000
(MS Word 9.0 Object Library), creating and merging data
into a new document. But in Access 2003 (MS Word 11.0
Object Library) it only creates an active document from a
template without merging the data, hence the mystery.
With gappWord
.Documents.Add strTemplatesPath & strDotName
.Selection.WholeStory
.Selection.Fields.Update
.Selection.HomeKey Unit:=wdStory
.ActiveDocument.SaveAs strPath & strNewFileName
.Visible = True
.ActiveWindow.WindowState = wdWindowStateMaximize
.Activate
End With
VBA code doesn't merge data into a Word 2003 template! The
code is used in an Access 2000/2002/2003 database. The
variables are fine, and the code works fine in Access 2000
(MS Word 9.0 Object Library), creating and merging data
into a new document. But in Access 2003 (MS Word 11.0
Object Library) it only creates an active document from a
template without merging the data, hence the mystery.
With gappWord
.Documents.Add strTemplatesPath & strDotName
.Selection.WholeStory
.Selection.Fields.Update
.Selection.HomeKey Unit:=wdStory
.ActiveDocument.SaveAs strPath & strNewFileName
.Visible = True
.ActiveWindow.WindowState = wdWindowStateMaximize
.Activate
End With