OLE object manual update

G

Guest

Access 200

I am using an OLE object to hold a base Word doc that I want to manipulate with an Access subroutine. I am getting the code to make changes to the doc in the OLE; however, even if I specify update manual in the properties, the OLE is updated. I need a way to close the OLE object without updates being stored

Option Compare Databas

Private Sub Print_btn_Click(
Dim objWord As Objec
' Disable document so code will operat
Me!Document.Enabled = Fals
' Assign object property of control to variable
Set objWord = Me!Document.Object.Application.Wordbasi
' Assign customer address to variables
' ' Activate ActiveX control
Me!Document.Action = acOLEActivat
With objWor
.EditSelectAl
.EditCop
.EndOfDocumen
.InsertBreak Type:=wdPageBrea
.EditPast
' the following command has been .Fileexit als
.FileClos
End Wit
Set objWord = Nothin
' Re-enable document vor viewing in for
Me!Document.Enabled = Tru
End Su

How do I quit the word session without updates beeing applied to the OLE object in the table?
 
T

TC

Are you sure that the FileClose statement does not have a "discard changes"
option? Check the WordBasic documentation.

If the doc is Word 97 or higher, perhaps you could use Word VBA instead of
WordBasic. The progid of Word VBA, is Word.Application. In Access VBA, I
would say CreateObject("Word.Application"). In your syntax (which I'm not
familiar with), maybe use ...Application.Word instead of
.....Application.WordBasic? Then use the Word VBA Close or Quit commands, at
least one of which does have a "discard changes" parameter.

HTH,
TC


MarkB said:
Access 2002

I am using an OLE object to hold a base Word doc that I want to manipulate
with an Access subroutine. I am getting the code to make changes to the doc
in the OLE; however, even if I specify update manual in the properties, the
OLE is updated. I need a way to close the OLE object without updates being
stored.
Option Compare Database

Private Sub Print_btn_Click()
Dim objWord As Object
' Disable document so code will operate
Me!Document.Enabled = False
' Assign object property of control to variable.
Set objWord = Me!Document.Object.Application.Wordbasic
' Assign customer address to variables.
' ' Activate ActiveX control.
Me!Document.Action = acOLEActivate
With objWord
.EditSelectAll
.EditCopy
.EndOfDocument
.InsertBreak Type:=wdPageBreak
.EditPaste
' the following command has been .Fileexit also
.FileClose
End With
Set objWord = Nothing
' Re-enable document vor viewing in form
Me!Document.Enabled = True
End Sub

How do I quit the word session without updates beeing applied to the OLE
object in the table?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top