Modifying textfield font attributes via Basic macro
-
- Posts: 31
- Joined: Mon Aug 11, 2008 1:10 pm
Modifying textfield font attributes via Basic macro
Is it possible to programatically (via Basic macro) change the font attributes (e.g., bold, italics) of a textbox created in the Dialog editor? If so, (a) please point me to an example, (b) please point me to the API documentation, and (c) pretty, pretty please tell me the logic that you used to figure out how to do it (I feel like I'm in a Macro/Dialog noob information maze).
OOo 3.4.1 on Mac OS X 10.6.8
Re: Modifying textfield font attributes via Basic macro
a:
b: http://www.openoffice.org/api/docs/comm ... Model.html
Property values starting with "Font" are not listed in the document, they are generated from member of css.awt.FontDescriptor.
c: http://wiki.openoffice.org/wiki/Documen ... /UNO_Tools
Code: Select all
Sub DialogTest
d = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
oFieldModel = d.getControl("TextField1").getModel()
oFieldModel.FontWeight = com.sun.star.awt.FontWeight.BOLD
oFieldModel.FontSlant = com.sun.star.awt.FontSlant.ITALIC
d.execute()
d.dispose()
End Sub
Property values starting with "Font" are not listed in the document, they are generated from member of css.awt.FontDescriptor.
c: http://wiki.openoffice.org/wiki/Documen ... /UNO_Tools
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04