G
G
I have a procedure that opens a word document (*.doc) and populates the
document with data from an *.mdbat particular bookmarks. Is there a method
to programmatically open a new document based on a *.dot? That way I do not
have to worry about modifications being made to the bookmarked file. T
Any ideas. Thanks.
Here is a snippet of code I am using now:
Dim objWord As Object
Dim objDoc As Object
Dim strFullPathAndFileName As String
'build the path to the rma form
strRMA = "RMA Request Form rev 2004-08-27"
strFullPathAndFileName = "l:\database\customer support\" & strRMA &
".doc"
'Opens word
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
'opens the document
Set objDoc = objWord.Documents.Open(strFullPathAndFileName)
'write to the document at the bookmarks
With objWord.ActiveDocument.Bookmarks
.Item("MN").Range.InsertAfter (((UCase(Forms("FrmRMARequest")("MN")))))
.Item("SN").Range.InsertAfter (((Forms("FrmRMARequest")("SN"))))
.Item("PN").Range.InsertAfter (((Forms("FrmRMARequest")("PN"))))
.Item("RmaDate").Range.InsertAfter
(((Forms("FrmRMARequest")("RequestDate"))))
document with data from an *.mdbat particular bookmarks. Is there a method
to programmatically open a new document based on a *.dot? That way I do not
have to worry about modifications being made to the bookmarked file. T
Any ideas. Thanks.
Here is a snippet of code I am using now:
Dim objWord As Object
Dim objDoc As Object
Dim strFullPathAndFileName As String
'build the path to the rma form
strRMA = "RMA Request Form rev 2004-08-27"
strFullPathAndFileName = "l:\database\customer support\" & strRMA &
".doc"
'Opens word
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
'opens the document
Set objDoc = objWord.Documents.Open(strFullPathAndFileName)
'write to the document at the bookmarks
With objWord.ActiveDocument.Bookmarks
.Item("MN").Range.InsertAfter (((UCase(Forms("FrmRMARequest")("MN")))))
.Item("SN").Range.InsertAfter (((Forms("FrmRMARequest")("SN"))))
.Item("PN").Range.InsertAfter (((Forms("FrmRMARequest")("PN"))))
.Item("RmaDate").Range.InsertAfter
(((Forms("FrmRMARequest")("RequestDate"))))