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

Need macro to type with Ctrl-N

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
Carlos
Guest





PostPosted: Tue Aug 12, 2003 1:10 pm    Post subject: Need macro to type with Ctrl-N Reply with quote

I use the english keyboard but need to assing Ctrl-N to .
I used to do this with WinWord for Win98 but can't figure how to do it with OO
Thanks

Carlos
Back to top
Guest






PostPosted: Wed Aug 13, 2003 7:27 am    Post subject: Reply with quote

How to assign a special key sequence to a
macro.

First, record your macro and save it (use
Tools/ Macro / Record Macro).

Next, (after being returned to document after
saving your new macro)
select your new macro and click on the
'assign' function (from list of options on right).
(If it is not obvious, the macro will be under
soffice / standard / module 1 in the tree listing
of all macros.)

When you click on 'assign' you'll get a new
listing of all macros. Find yours. It should be
under 'Openoffice.org Basic Macros / Standard /
Module 1' in the tree listing. Select you macro
name. And from the list of key sequences above,
select the one you want to assign to your
macro.

Do NOT then click on OK. Instead, click on
'modify' (from option list to the right), and
then click on OK at bottom.

Your macro should now run when you hit
the assigned key sequence. Pretty clunky,
isn't it? Maybe someone knows a better,
more efficient way to do this ... Crying or Very sad
Back to top
Ruben
Guest





PostPosted: Thu Aug 14, 2003 5:00 am    Post subject: Re:Need macro to type with Ctrl-N Reply with quote

You can use the US International keyboard instead. It has the same key loactions, but it allows you to use the Alt key on the right side of the space bar as a hot key for entering other letters. For example, Alt+n gives you . This works equally well on Windows and Linux.

The only thing I haven't figured out is how to enter the open question mark "" on Linux. When I try Alt+? nothing happens (using RedHat 8.0 with US International Keyboard). Does any one know how to do this?
Back to top
Guest






PostPosted: Thu Aug 14, 2003 3:24 pm    Post subject: Reply with quote

Try to insert this into Macros-Standard-Module1 (or any other Module you created yourself).

Please note that this is definitely NOT my invention - I copied it from one of the collections by more talented people here among OO-fans.

Code:
Function insertSpecialChar(sChar)
'sChar is the char to be inserted
Dim oDocument as Object
Dim oText as Object
Dim oVCursor, oCursor As Object
oDocument=thiscomponent
oText = oDocument.Text
' after this, an obscure call gets the current cursor position
oVCursor = oDocument.currentcontroller.getViewCursor()
oText.insertString(oVCursor.getStart(),sChar,false)
End Function

Sub egrave
'for example ...
insertSpecialChar("")
End Sub


You may change the character in parentheses in row last but one for (I think) any other.
The code the for the special Spanish n tilde is ALT 0241.
The code for the upside down questiojn mark is ALT 0191

Change the name Sub egrave (row last but four) to e.g. ntilde

You may then assign certain key combinations to this macro through the Customize option. However, Control N seems to be quite attached to new document.

For me it works properly for several different accented characters. To add more than just n tilde, multiply only the Sub --- End Sub section and change what is necessary.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer 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