I suppose you do not use the same version of OpenOffice (I'm running 2.0.4), because the args table is not organised the same way.
Meanwhile I commented out the lines

args1(1).Name = "FontName"
args1(1).Value = "Times New Roman"

so the macro runs correctly with a font other than Times New Roman.
Marc H.





TerryJ a écrit :

The macro looks the same as others I have recorded.  "uno:InsertSymbol"
should insert the same symbol.

When I ran your macro, the software crashed.  I recorded my own and got
this:

- - - - - quote - - - - -
sub recInsiac
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(5) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Font.StyleName"
args1(0).Value = "Medium"
args1(1).Name = "Font.Pitch"
args1(1).Value = 0
args1(2).Name = "Font.CharSet"
args1(2).Value = -1
args1(3).Name = "Font.Family"
args1(3).Value = 3
args1(4).Name = "Font.FamilyName"
args1(4).Value = "Times"
args1(5).Name = "Symbols"
args1(5).Value = "í"

dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "StringName"
args2(0).Value = "í"

dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())


end sub

- - - end quote - - -

I do not understand the last line at all because I did NOT move the cell
pointer to another cell.  ???

There is an alternative macro recorder and an additional Calc recorder.  The
latter is on www.ooomacros.org and you will find a link (and explanation)
for the former (and, IIRC, a link for the latter as well) on
http://www.oooforum.org/forum/viewtopic.phtml?t=50952

Regards.


Marc Hug wrote:
Thank you for your reply, and thanks to TerryJ too.
Actually, what happens is that when I change the Language of the User Interface, the Keyboard shortcuts are set to default, so the shortcuts I installed for the French interface do not work any more. Sure the macro still is here, but I cannot use "<Crtl><Shift>i" to execute it. When I try "<Crtl><Shift>i", nothing happens (the default meaning seems to be something related with selecting text). See Options > Customise >Keyboard. I know that "í" doesn't exist in English. Is doesn't exist in French either; that's why it is not on my French keyboard.
The macro looks like the text below.
Of course, I did not write this, but used the macro editor of OpenOffice.

Marc H.

MACRO:
rem --------------------------
sub iaigu
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(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Symbols"
args1(0).Value = "í"
args1(1).Name = "FontName"
args1(1).Value = "Times New Roman"
dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())
end sub
rem--------------------------


Johnny Andersson a écrit :

Do you mean that you have a macro which you assigned to Ctrl+Shift+i (isn't that the same is Ctrl+I, by the way...? ;) ) and which just write an í for
you? And it doesn't work when the language is switched to English?

Exactly what does that macro look like? And what happens when you try to run
it in English mode? Do you get an error message or doesn't it just do
anything?

It could be good to know. I write macros (or at least try to) now and then
and it ouwld be nice to know these things.

Johnny Andersson

2007/2/19, Marc Hug <[EMAIL PROTECTED]>:

Hi. Maybe this is not a bug, but it might be interesting for some people
to know it.
I normally use OpenOffice in the French version. In order to see what
words are used in the English (UK) version, I changed temporarily the
Language Settings, selecting English for the User Interface. Once I had
done this, my macros did not work any more (e.g. <Ctrl><Shift>i
displaying í -I mean &iacute;). When I re-install the French Interface,
the macros do work again.
So macros can be depending on Language settings.
Marc H.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to