P
pvp
You were very helpful last time so I thought I'd run to
you with this one...
I am in an Access form and I doubleclick on a bound OLE
object which is a Word file. this will open the file and
I can then faff around inside it, etc... and save it. All
OK.
Goody! I hear you cry. But...
I want to open this Word file (before the double-click
takes effect and presents the file in the Word
application 'thorugh' Access) and stick some text in it,
then save this text. Then the file would open as usual in
the Word aplication with newly added text I programmed.
How would you do this?
I tried to open the file as a Word doc and as a Word app
and both end up failing:
"
'Dim docApp As Word.Application
'Dim docDoc As Word.Document
'Set docApp = GetObject("C:\counselog docs\" &
Me.Text51 & ".doc", "Word.Application")
'Set docDoc = GetObject("C:\counselog docs\" &
Me.Text51 & ".doc")
'Set docDoc = docApp.Documents.Add
'docApp.selection.typetext "__________________________
_" & vbCrLf
'docApp.selection.typetext "General Comment:" & vbCrLf
'docDoc.Close wdSaveChanges
'Set docApp = Nothing
"
(It's all commented out but I have tried most
combinations and failed!)
Waiting with bated breath.
Thanks.
you with this one...
I am in an Access form and I doubleclick on a bound OLE
object which is a Word file. this will open the file and
I can then faff around inside it, etc... and save it. All
OK.
Goody! I hear you cry. But...
I want to open this Word file (before the double-click
takes effect and presents the file in the Word
application 'thorugh' Access) and stick some text in it,
then save this text. Then the file would open as usual in
the Word aplication with newly added text I programmed.
How would you do this?
I tried to open the file as a Word doc and as a Word app
and both end up failing:
"
'Dim docApp As Word.Application
'Dim docDoc As Word.Document
'Set docApp = GetObject("C:\counselog docs\" &
Me.Text51 & ".doc", "Word.Application")
'Set docDoc = GetObject("C:\counselog docs\" &
Me.Text51 & ".doc")
'Set docDoc = docApp.Documents.Add
'docApp.selection.typetext "__________________________
_" & vbCrLf
'docApp.selection.typetext "General Comment:" & vbCrLf
'docDoc.Close wdSaveChanges
'Set docApp = Nothing
"
(It's all commented out but I have tried most
combinations and failed!)
Waiting with bated breath.
Thanks.