T
Ted S
I'm building a database to drive a work order system. I have a set of about 30 word 2003 documents that each contains from 1 up to 6 PM tasks. I've found that I can edit the .doc's, paint the text of the individual task andassign it a bookmark name so that whenever the named bookmark is selected the text of that task is selected/painted.
I want to enable the user to print out the bookmarked task with a buttonclick such that Access opens Word, selects the bookmark, prints the selected text and quits word without saving.
This code works but it prompts to save. How can I close without saving? Many thanks in advance for your efforts and assistance.
Private Sub Command12_Click()
Dim strFile As String
Dim Wd As Object
Set Wd = CreateObject("Word.Application")
strFile = "F:\PM\08\MIP\AutoPurger.doc"
Set Wd = GetObject(strFile)
Wd.Windows(1).Visible = False
With Wd.ActiveWindow
.Selection.GoTo Name:="OperationalInspection"
.Selection.Find.ClearFormatting
.Application.PrintOut FileName:="", Range:=1
End With
Wd.Application.Quit , 0
Set Wd = Nothing
End Sub
I want to enable the user to print out the bookmarked task with a buttonclick such that Access opens Word, selects the bookmark, prints the selected text and quits word without saving.
This code works but it prompts to save. How can I close without saving? Many thanks in advance for your efforts and assistance.
Private Sub Command12_Click()
Dim strFile As String
Dim Wd As Object
Set Wd = CreateObject("Word.Application")
strFile = "F:\PM\08\MIP\AutoPurger.doc"
Set Wd = GetObject(strFile)
Wd.Windows(1).Visible = False
With Wd.ActiveWindow
.Selection.GoTo Name:="OperationalInspection"
.Selection.Find.ClearFormatting
.Application.PrintOut FileName:="", Range:=1
End With
Wd.Application.Quit , 0
Set Wd = Nothing
End Sub