G
Guest
I have access forms that open Word templates to create word documents. When
I'm done typing on the Word documents, I want to be able to import the
information I've typed back into Access. It's pretty simple to export data
from Access into Word by automation, but there is nothing much written on
doing the reverse.
The easiest way would seen to be to use DDE in the close/quit event of the
Word template. For the life of me, I can't figure out the syntax to do this.
I can "almost" get there using DDE from the Access side as follows:
Private Sub OpenWordTemplate_Click ()
'code that opens template and fills various fields
While objWord.IsObjectValid("test.dot")
'code here that as long as the word document is open,
'Access "hangs"
Wend
Dim Channel as Long
Channel = DDEInitiate("WinWord", Topic:="test.dot")
strBodyBookmark = DDERequest(Channel, "bodybookmark")
End Sub
But my problem is that I want to trigger the request for this information at
the close/quit event in the Word (to capture the last version of the
document); and a document has to be open to use DDE.
Any thoughts or suggestions would be greatly appreciated.
Bruce Maston
I'm done typing on the Word documents, I want to be able to import the
information I've typed back into Access. It's pretty simple to export data
from Access into Word by automation, but there is nothing much written on
doing the reverse.
The easiest way would seen to be to use DDE in the close/quit event of the
Word template. For the life of me, I can't figure out the syntax to do this.
I can "almost" get there using DDE from the Access side as follows:
Private Sub OpenWordTemplate_Click ()
'code that opens template and fills various fields
While objWord.IsObjectValid("test.dot")
'code here that as long as the word document is open,
'Access "hangs"
Wend
Dim Channel as Long
Channel = DDEInitiate("WinWord", Topic:="test.dot")
strBodyBookmark = DDERequest(Channel, "bodybookmark")
End Sub
But my problem is that I want to trigger the request for this information at
the close/quit event in the Word (to capture the last version of the
document); and a document has to be open to use DDE.
Any thoughts or suggestions would be greatly appreciated.
Bruce Maston