J
Jeremy Gollehon
From Access VBA I can control a specific word doc like so:
----------------------------------------------------------------------------
Sub GetWordDoc()
Dim appWd As Word.Application
Dim docName As String
docName = "D:\MyFolder\MyDoc.doc"
On Error Resume Next
Set appWd = GetObject(, "Word.Application")
If appWd Is Nothing Then
Set appWd = New Word.Application
End If
If Not appWd.Documents(docName) Is Nothing Then
appWd.Documents.DoWhatever
End If
On Error GoTo 0
Set appWd = Nothing
End Sub
----------------------------------------------------------------------------
The .Documents collection allows for this functionality. If more than one
instance of Word is open the Documents collection gets me to the specific
file I'd like to work with.
How would I approach the same thing when referencing another Access file?
appAccess.???
Ultimately I'm looking to close one Access file from another.
Thanks,
-Jeremy
----------------------------------------------------------------------------
Sub GetWordDoc()
Dim appWd As Word.Application
Dim docName As String
docName = "D:\MyFolder\MyDoc.doc"
On Error Resume Next
Set appWd = GetObject(, "Word.Application")
If appWd Is Nothing Then
Set appWd = New Word.Application
End If
If Not appWd.Documents(docName) Is Nothing Then
appWd.Documents.DoWhatever
End If
On Error GoTo 0
Set appWd = Nothing
End Sub
----------------------------------------------------------------------------
The .Documents collection allows for this functionality. If more than one
instance of Word is open the Documents collection gets me to the specific
file I'd like to work with.
How would I approach the same thing when referencing another Access file?
appAccess.???
Ultimately I'm looking to close one Access file from another.
Thanks,
-Jeremy