Hi friends,
I want to get the Page Number of the DependentTextFields.
I haven given below my code.
oFieldMaster = ThisComponent.TextFieldMasters
oField = oFieldMaster.getByName("com.sun.star.text.fieldmaster.SetExpression.Left_Guideword_L")
stDTF = oField.DependentTextFields
stDFT has array of Text fields. I want to get the Page Number of each field.
Thank you.
James
[Solved] How to get the Page Number of Text Fields
-
- Posts: 4
- Joined: Tue May 06, 2014 3:38 pm
[Solved] How to get the Page Number of Text Fields
Last edited by id_james2000 on Fri May 09, 2014 9:29 am, edited 2 times in total.
OpenOffice 3.1 on Windows Vista
Re: How to get the Page Number of Text Fields
The only way I know of to get a page location is with the ViewCursor. I would use code like this
Code: Select all
oVC = ThisComponent.CurrentController.ViewCursor
oTextFields = ThisComponent.TextFields
FieldEnum = oTextFields.createEnumeration()
While FieldEnum.hasMoreElements
oField = FieldEnum.nextElement()
Anch = oField.Anchor
oVC.gotoRange(Anch.Start, False)
Print oVC.Page
Wend
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
-
- Posts: 4
- Joined: Tue May 06, 2014 3:38 pm
Re: How to get the Page Number of Text Fields
Dear FJCC,
Thank you so much. Your code solved my problem.
Great Help.
James
Thank you so much. Your code solved my problem.
Great Help.
James
OpenOffice 3.1 on Windows Vista