B
BarryM
In Access 97 I want to open some Word documents at the same time without
creating more than one instance of Word.
The following code works but I have been unable to maximise the Word window
(not the document window) using code in access. Any suggestions?
Many thanks in anticipation.
Public Sub GetGuidesDoc(strDoc As String)
On Error GoTo ErrDocs
Dim MyWord As Object
'Open Word
Set MyWord = GetObject(, "Word.Application") 'error if Word not running
OpenDoc:
'Open the selected document
MyWord.Documents.Open strDoc
MyWord.Application.Visible = True
Exit Sub
ErrDocs:
Select Case Err
Case 429 'ActiveX component can't create object
'Word not running, open it
Set MyWord = GetObject("", "Word.Application")
GoTo OpenDoc
Case Else
MsgBox "Error " & Err & ": " & Error, 0 + 64, "Opening Word Docs"
End Select
End Sub
creating more than one instance of Word.
The following code works but I have been unable to maximise the Word window
(not the document window) using code in access. Any suggestions?
Many thanks in anticipation.
Public Sub GetGuidesDoc(strDoc As String)
On Error GoTo ErrDocs
Dim MyWord As Object
'Open Word
Set MyWord = GetObject(, "Word.Application") 'error if Word not running
OpenDoc:
'Open the selected document
MyWord.Documents.Open strDoc
MyWord.Application.Visible = True
Exit Sub
ErrDocs:
Select Case Err
Case 429 'ActiveX component can't create object
'Word not running, open it
Set MyWord = GetObject("", "Word.Application")
GoTo OpenDoc
Case Else
MsgBox "Error " & Err & ": " & Error, 0 + 64, "Opening Word Docs"
End Select
End Sub