Go to the menu item...
Tools >> Macros >> Organise Macros >> Openoffice.orb basic and the following window should turn up...
Click edit and a text editor should appear that contain the macro code. All you need to do is move to the end and past in this code...
Code: Select all
sub Club
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = "♣"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub
sub Diamond
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = "♦"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub
sub Heart
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = "♥"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub
sub Spade
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = "♠"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub
Now we need to assign these to a short cut. Choose the menu item...
Tools >> Customise
Then choose the keyboard tab. Scroll down the key combinations list box until you see the alt-c option etc.
You then choose openoffice.org macros >> user >> standard >> module and choose the appropriate function. Lets start with the "Club" function. Select alt-c in the shortcuts list and the click modify. This will then associate alt-c with the clubs function. Do this for each suit shortcut you want and then click OK.
Good luck!