VB Code:
'this should give you the general idea
Dim WordObject As Word.Application
Set WordObject = CreateObject("Word.Application")
With WordObject
.Documents.Open ("c:\program files\qcap\transmove.doc")
.ActiveDocument.Bookmarks("transtype").Select
' reapply the boomark name to the selection
'.ActiveDocument.Bookmarks.Add Name:="First",Range:=Selection.Range
.ActiveDocument.Bookmarks("fromlocation").Select
.Selection.Text = (lblMoveFrom.Caption)
.ActiveDocument.Bookmarks("tolocation").Select
.Selection.Text = (lblMoveTo.Caption)
.ActiveDocument.Bookmarks("numbers").Select
.Selection.Text = (txtStatus.Text)
.ActiveDocument.Bookmarks("preparedby").Select
.Selection.Text = (UCase(UserAccount))
.ActiveDocument.Bookmarks("comments").Select
.Selection.Text = (txtComments.Text)
.ActiveDocument.Bookmarks("movedate").Select
.Selection.Text = (Today)
End With
WordObject.Visible = False
WordObject.ActiveDocument.PrintOut Background:=False
WordObject.ActiveDocument.SaveAs FileName:="x.doc"
' setting the printing to background will display the document
' on the screen while it is being printed
' WordObject.Documents.Close '("c:\program files\qcap\transmove.doc")
WordObject.Application.Documents.Close
Set WordObject = Nothing