acOLEClose

  • Thread starter Thread starter fly girl
  • Start date Start date
F

fly girl

What are the criteria under which I can close an activated
OLE object with acOLEClose?

I am currently trying to trap the instance in which a user
opens an object, modifies it, saves it but doesn't close
the object and then moves off of the record.

Currently if the user moves off of the record without
closing the object it is left hanging open in the native
app. I want to close it so that I can copy the file in
order to capture any changes and, of course, for general
tidiness...

I have tried to close the object in both _Updated and
_AfterUpdate events and it simply won't close the file.

Code was simple:

MyControl.Action = acOLEClose

No error occurs, but the file is not closed.

Thanks for your help!
 
Hi,

What effects do you want to achieve? Could you please post the reproduce
steps?

acOLEClose is used to Close an OLE object and end the connection with the
application that supplied the object. This setting applies to embedded
objects only. Using this setting is equivalent to clicking Close on the
object's Control menu.


Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "fly girl" <[email protected]>
| Sender: "fly girl" <[email protected]>
|
| What are the criteria under which I can close an activated
| OLE object with acOLEClose?
|
| I am currently trying to trap the instance in which a user
| opens an object, modifies it, saves it but doesn't close
| the object and then moves off of the record.
|
| Currently if the user moves off of the record without
| closing the object it is left hanging open in the native
| app. I want to close it so that I can copy the file in
| order to capture any changes and, of course, for general
| tidiness...
|
| I have tried to close the object in both _Updated and
| _AfterUpdate events and it simply won't close the file.
|
| Code was simple:
|
| MyControl.Action = acOLEClose
|
| No error occurs, but the file is not closed.
|
| Thanks for your help!
|
 
You have given me the info I needed. Hadn't seen in the
documentation a statement that acOLEClose only works on
embedded objects.

I was trying to close a linked object.

Thanks!
 
Hi,

If you use acOLEVerbOpen, on OLE Server side, it seems we can close the
separate open Window; we can try the following code to close it.

Dim objWord As Word.Application
Dim objDoc As Word.Document

Set objWord = GetObject(, "Word.Application")
Set objDoc = objWord.ActiveDocument

objDoc.Close SaveChanges:=wdSaveChanges

objWord.Quit SaveChanges:=wdSaveChanges

Set objWord = Nothing

Please let me know if the above information helps. If you have any concerns
or questions, please feel free to reply to the threads.



Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| What are the criteria under which I can close an activated
| OLE object with acOLEClose?
|
| I am currently trying to trap the instance in which a user
| opens an object, modifies it, saves it but doesn't close
| the object and then moves off of the record.
|
| Currently if the user moves off of the record without
| closing the object it is left hanging open in the native
| app. I want to close it so that I can copy the file in
| order to capture any changes and, of course, for general
| tidiness...
|
| I have tried to close the object in both _Updated and
| _AfterUpdate events and it simply won't close the file.
|
| Code was simple:
|
| MyControl.Action = acOLEClose
|
| No error occurs, but the file is not closed.
|
| Thanks for your help!
|
 
Back
Top