I need to program the enter key to function like Shift-Enter in MS Word. Can
this be done?
Yes, but I wouldn't recommend doing it wholesale :-). I would create a
template with the following macros and use it for documents that you want use
this feature for:
Sub AutoNew()
'Assigns the Macro1 Macro to the ENTER Key
CustomizationContext = ActiveDocument.AttachedTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyReturn), _
KeyCategory:=wdKeyCategoryMacro, Command:="Macro1"
End Sub
Sub AutoOpen()
'Assigns the Macro1 Macro to the ENTER Key
CustomizationContext = ActiveDocument.AttachedTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyReturn), _
KeyCategory:=wdKeyCategoryMacro, Command:="Macro1"
End Sub
Sub AutoClose()
CustomizationContext = ActiveDocument.AttachedTemplate
FindKey(KeyCode:=BuildKeyCode(wdKeyReturn)).Disable
'Disables prompt to save template changes
Templates(1).Save
End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded December 1, 2004 by CDR Gregory K. Maxey
'
Selection.TypeText Text:=Chr(11)
End Sub
> I need to program the enter key to function like Shift-Enter in MS Word. Can
> this be done?
jbickel - 01 Dec 2004 19:23 GMT
I did create the macro but I couldn't find out how to assign it to the enter
key. Now if I understand this right I need to be sure this if the first
macro in my template correct? Since the sub items refer to macro 1??? Is
this correct?
thank you for your response.
> Yes, but I wouldn't recommend doing it wholesale :-). I would create a
> template with the following macros and use it for documents that you want use
[quoted text clipped - 35 lines]
> > I need to program the enter key to function like Shift-Enter in MS Word. Can
> > this be done?
Lesley Regan - 01 Dec 2004 20:59 GMT
Hello, jbickel,
You don't need to make sure the Macro1 macro is first in the template. Try
it and see!
Regards,
Lesley
> I did create the macro but I couldn't find out how to assign it to the enter
> key. Now if I understand this right I need to be sure this if the first
[quoted text clipped - 42 lines]
> > > I need to program the enter key to function like Shift-Enter in MS Word. Can
> > > this be done?
jbickel - 06 Dec 2004 15:01 GMT
I have added the following templates to my template (this template is not a
normal template but a templated added through the start-up folder). I have
placed the template in Startup but the shift enter feature is not working.
If I open the template up it works fine. Any thoughts???
> Yes, but I wouldn't recommend doing it wholesale :-). I would create a
> template with the following macros and use it for documents that you want use
[quoted text clipped - 35 lines]
> > I need to program the enter key to function like Shift-Enter in MS Word. Can
> > this be done?