OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Macro: Troggle between straight and curl quotes

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
hwtan
OOo Advocate
OOo Advocate


Joined: 24 Aug 2004
Posts: 320
Location: Singapore

PostPosted: Mon Apr 13, 2009 5:44 pm    Post subject: Macro: Troggle between straight and curl quotes Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group