Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

shift enter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jbickel - 01 Dec 2004 18:37 GMT
I need to program the enter key to function like Shift-Enter in MS Word.  Can
this be done?
Greg - 01 Dec 2004 19:15 GMT
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?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.