To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=70149
Issue #|70149
Summary|Runing macro when document is closed doesn't work
Component|api
Version|OOo 2.0.3
Platform|PC
URL|http://www.oooforum.org/forum/viewtopic.phtml?t=44610
OS/Version|Windows XP
Status|UNCONFIRMED
Status whiteboard|
Keywords|
Resolution|
Issue type|DEFECT
Priority|P2
Subcomponent|code
Assigned to|jsc
Reported by|oisin_
------- Additional comments from [EMAIL PROTECTED] Fri Oct 6 02:23:06 -0700
2006 -------
Under Tools -> Configure -> Events in Writer there are two events regarding the
closing of a document: Document close and Document is closing (in German i.e
Dokument schließen and Dokument wird geschlossen.
The first is executed before the user is asked whether he is sure and whether
he wants to save and the second is executed when the document is really closed.
In my case, I want to implement the second but here is my problem: Writer seems
to dispose the basic code before the macro is executed thus throwing an error
upon closing the document.
To reproduce try the following:
- Create a new Writer document
- Create a macro.
Sub DocumentIsClosing
msgbox "DocumentIsClosing"
End Sub
- Tools -> Configure -> Events -> Document is closing -> Assign --> select the
unnamed document -> Standard -> Modul1 -> DocumentIsClosing --> OK --> OK
- save the document
- close the document --> Error in scripting framework:
BasicProviderImpl::getScript: no script!
Apparently the scripts are removed, before the actual document is closed.
This would work if the code would be placed in a library outside the document.
But in my scenario described in http://www.oooforum.org/forum/
viewtopic.phtml?p=176559#176559 this is not practicable. I need the code to be
inside the document being closed.
My suggestion would be to keep the scripts until all relevant events have been
fired. Macros in a document should no rely on funtionality in an external
library.
Background:
Upon opening the document I assign listeners to form controls that have to be
removed upon closing. If this removal isn't done, OOo crashes.
P.S. If this isn't the correct component for the issue, please move it. I
wasn't very sure about which component to choose.
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]