hwtan OOo Advocate


Joined: 24 Aug 2004 Posts: 320 Location: Singapore
|
Posted: Mon Apr 13, 2009 5:44 pm Post subject: Macro: Troggle between straight and curl quotes |
|
|
I need to switch between straight and curl quotes quite frequently. I tried to record a macro without success.
Here is what I did:
1. start the macro the recorder.
2. Alt T to go the Tools
3. select "AutoCorrect" with arrow key and enter.
4. While the Tab selected, use the arrow key to go to Custom quotes.
5. Use the Tab key to move to the first check box and the Space Bar to select, then do the same to the other quote.
5. Use the Tab key to move to the OK button and select it with the Enter key.
6. Stop the recorder and save as CurlQuotes. I repeat the whole process but this time removing the check box and saved as StraightQuotes.
The following are the codes generated by OOo:
sub StraightQuotes
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 ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:AutoCorrectDlg", "", 0, Array())
end sub
sub CurlQuotes
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 ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:AutoCorrectDlg", "", 0, Array())
When I run the Macros, nothing happened. What has went wrong? |
|