Bonjour Cedric Bosdonnat
Message du 2006-11-13 16:53:
Hi all,
I'm developping a macro using and updating User Text fields in a
document template. I have two options to create the document:
1 - File > New > Documents and Templates
2 - loadComponentURL()
The macro is executed at the document creation. When creating the
document with method (1) there is no problem: the User fields are
updated. But when creating the document with method (2) the macro cannot
find any text field in the document. The following code returns false
instead of true:
ThisComponent.getTextFields().createEnumeration().hasMoreElements()
I do not reproduce your problem with textfields, but I found another
which may explain yours.
With OOo 2.0.4 on Win XP Home.
In a writer document, I execute a macro which creates a new document
from an existing template. This template contains several textFields
(Date, Time) and a macro started at document creation, which writes on
the created document the number of textfields it contains. Then the
calling macro stores the document and closes it.
Case Hidden= False in loadComponentFromURL
If the calling macro stores the new document after several seconds, or
after displaying a msgbox, I find the expected number of TextFields
written on the new document.
If the calling macro stores too quickly, nothing is written on the new
document (even with no textField something should be written).
Case Hidden= True
nothing is written on the new document.
The problem I found is not related to textFields, of course.
*Remark*
There is no such problem with OOo 1.1.5. Everything is OK with exactly
the same macros.
I can provide the documents or create an Issue with them.
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]