OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Update fields in writer

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Angellina
OOo Enthusiast
OOo Enthusiast


Joined: 28 May 2004
Posts: 130
Location: France - Paris

PostPosted: Wed Jul 28, 2004 7:50 am    Post subject: Update fields in writer Reply with quote

Hello everybody,

I have to update the values of fields contained in the document,
in VBA , the instruction is:

Code:
  ActiveDocument.Fields.Update


So I've done :

Code:
 objField = thiscomponent.getTextFieldMasters()
objField.update()


but it failed at the second instruction,
can anyone help me please?

thank u
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3152
Location: Columbus, Ohio, USA

PostPosted: Wed Jul 28, 2004 8:07 am    Post subject: Reply with quote

Does this work?
Code:
ThisComponent.getTextFields().refresh()

_________________
--
Andrew Pitonyak
My Document: http://www.pitonyak.org/AndrewMacro.odt
Free Info: http://www.pitonyak.org/oo.php
Most hated bug: http://www.openoffice.org/issues/show_bug.cgi?id=84159
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Angellina
OOo Enthusiast
OOo Enthusiast


Joined: 28 May 2004
Posts: 130
Location: France - Paris

PostPosted: Wed Jul 28, 2004 11:28 pm    Post subject: Reply with quote

YES IT WORKS!!!!

thank you, but how have you found it? is it a struct? I've searched but without success!
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3152
Location: Columbus, Ohio, USA

PostPosted: Thu Jul 29, 2004 6:14 am    Post subject: Reply with quote

Quote:
thank you, but how have you found it? is it a struct? I've searched but without success!


So you want to know how I knew that I could do this? Remember that I wrote a book on this and in the process I spent a lot of time staring at the online IDL reference. Notice the progression. Start with a text document.

http://api.openoffice.org/docs/common/ref/com/sun/star/text/TextDocument.html

The text document, according to the link above, is a text fields supplier.

http://api.openoffice.org/docs/common/ref/com/sun/star/text/XTextFieldsSupplier.html

I will admit that a bit of a jump takes place here, but I obtained the text fields and inspected the object and also performed a goole search on "site:api.openoffice.org TextFields" and found

http://api.openoffice.org/docs/common/ref/com/sun/star/text/TextFields.html

This in turn demonstrated that the text fields service supports the refresh() method.

http://api.openoffice.org/docs/common/ref/com/sun/star/util/XRefreshable.html

I spend a lot of time using a search as mentioned above and inspecting objects. I describe the search process in my book and I also include a macro that inspects objects. The XRay object inspector is also a popular object browser that is available without purchasing my book.
_________________
--
Andrew Pitonyak
My Document: http://www.pitonyak.org/AndrewMacro.odt
Free Info: http://www.pitonyak.org/oo.php
Most hated bug: http://www.openoffice.org/issues/show_bug.cgi?id=84159
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group