I
IUnderstandSomething
- I am running an RunTime-Access 2000 and Word 2000.
- I have an Access-form with a bound object.
- When activating the object I want to put some of the data from my
form into the Word-document. This is where my system crash!
I manage to open the object, but if I try to call anything about
bookmarks it crashes!
I have tried :
*****************
Dim WordObj As Object
Dim WordDoc As Object
Dim WordRange As Range
With Forms![frmSosJournal]![Journal]
.Enabled = True
.Locked = False
.Class = "Word.Document"
.OLETypeAllowed = acOLEEmbedded
.SourceDoc = "n:\vakttjeneste\NyJournal.doc"
.Verb = -2 'acOLEVerbOpen
.Action = 0 'acOLECreateEmbed
.Action = acOLEActivate
End With
Set WordObj = Forms![frmSosJournal]!
[Journal].Object.Application
Set WordDoc = WordObj.ActiveDocument
Set WordRange = WordDoc.Goto(What:=-1, Name:="Kategori")
WordRange.InsertAfter "Test"
Set WordObj = Nothing
'***********************
and:
************
With Forms![frmSosJournal]![Journal]
.Object.Application.Goto what:=wdGoToBookmark, Name:=vBook
.Object.Application.TypeText Text:=vTekst
End with
************
but it crashes anyway!!
I am lost! Any ideas are welcome!
PS: It works fine on my laptop running Office 2003 Professional
- I have an Access-form with a bound object.
- When activating the object I want to put some of the data from my
form into the Word-document. This is where my system crash!
I manage to open the object, but if I try to call anything about
bookmarks it crashes!
I have tried :
*****************
Dim WordObj As Object
Dim WordDoc As Object
Dim WordRange As Range
With Forms![frmSosJournal]![Journal]
.Enabled = True
.Locked = False
.Class = "Word.Document"
.OLETypeAllowed = acOLEEmbedded
.SourceDoc = "n:\vakttjeneste\NyJournal.doc"
.Verb = -2 'acOLEVerbOpen
.Action = 0 'acOLECreateEmbed
.Action = acOLEActivate
End With
Set WordObj = Forms![frmSosJournal]!
[Journal].Object.Application
Set WordDoc = WordObj.ActiveDocument
Set WordRange = WordDoc.Goto(What:=-1, Name:="Kategori")
WordRange.InsertAfter "Test"
Set WordObj = Nothing
'***********************
and:
************
With Forms![frmSosJournal]![Journal]
.Object.Application.Goto what:=wdGoToBookmark, Name:=vBook
.Object.Application.TypeText Text:=vTekst
End with
************
but it crashes anyway!!
I am lost! Any ideas are welcome!
PS: It works fine on my laptop running Office 2003 Professional