2009/10/2 Eustace <emf...@gmail.com>: >> This macro is tricky for many reasons >> >> First, the macro works on the selected text. You would need to obtain the >> font size, but what if different portions uses different font sizes? The >> following macro is not very safe because it assumes that things are the same >> everywhere. >> >> Dim oSels As Object, oSel As Object >> Dim lSelCount As Long, lWhichSelection As Long >> >> oSels = ThisComponent.getCurrentSelection() >> If IsNull(oSels) Then >> Exit Sub >> End If >> If oSels.getCount() = 0 Then >> Exit Sub >> End If >> oSel = oSels.getByIndex(0) >> lSelCount = oSels.getCount() >> For lWhichSelection = 0 To lSelCount - 1 >> oSel = oSels.getByIndex(lWhichSelection) >> oSel.CharHeight = oSel.CharHeight * 1.1 >> Next >> >> You may not like this because it will take you from 12 to 13.1 I believe. >> >> The following converts to an integer, which may not be what you want: >> >> Dim oSels As Object, oSel As Object >> Dim lSelCount As Long, lWhichSelection As Long >> >> oSels = ThisComponent.getCurrentSelection() >> If IsNull(oSels) Then >> Exit Sub >> End If >> If oSels.getCount() = 0 Then >> Exit Sub >> End If >> oSel = oSels.getByIndex(0) >> lSelCount = oSels.getCount() >> For lWhichSelection = 0 To lSelCount - 1 >> oSel = oSels.getByIndex(lWhichSelection) >> oSel.CharHeight = CInt(oSel.CharHeight * 1.1) >> Next >> >> This may be enough to get you started. > > Thanks. The first is what I want. I'll have to make sure that all the > document uses the same font when I start. And I will have to add in the > beginning a command to select the whole text of the document, and at the end > to go to the beginning of the document. If I have any problems I'll will > post here again. BTW what is this language? Once upon a time I had learned > to use the language for WP macros... > > emf
OpenOffice.org BASIC Or some might prefer to call it StarBasic. J.R. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@openoffice.org For additional commands, e-mail: users-h...@openoffice.org