On 2009-09-28 07:54 Eustace wrote:
How can I make a macro to increase or decrease the font size of a
document by a certain percent (f.e. 10%)?
emf
I recorded a macro to change the font size from 12 to 13 and then opened
it to edit it. I found the following relevant lines:
======================================================================
sub IncreaseFontSize
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "FontHeight.Height"
args1(0).Value = 13
args1(1).Name = "FontHeight.Prop"
args1(1).Value = 100
args1(2).Name = "FontHeight.Diff"
args1(2).Value = 0
dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args1())
end sub
======================================================================
args2(0).Value is the resulting font size. Instead of
args1(0).Value = 13
I suppose I need something like:
args1(0).Value = getFontHeight() * 1.1
Actually I tried to replace the code as above, but the result was that
font size 12 became font size 2...
How do I get the current font size and then increase it?
And BTW what are the FontHeight.Prop, and FontHeight.Diff?
emf
--
It ain't THAT, babe! - A radical reinterpretation
https://files.nyu.edu/emf202/public/itaintmebabe/itaintme.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@openoffice.org
For additional commands, e-mail: users-h...@openoffice.org