I am trying to set 2 keys on the keyboard to run code from MyAddin, on the
server. I've tried the following unsuccessfully. (See the commented-out
code for what I also tried.) How can I reference an Addin when defining a
key?

Sub setKeys()
Dim myAddin As AddIn
Set myAddin = "g:\myAddin.dot" '"myAddin.dot"
CustomizationContext=NormalTemplate
KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
wdKeyCategoryMacro, Command:="time" 'myAddin.time"
CustomizationContext = NormalTemplate
KeyBindings.add KeyCode:=BuildKeyCode(wdKeyInsert), KeyCategory:= _
wdKeyCategoryMacro, Command:="Send"
End Sub

TIA

Re: define keys to run Addin code by Word

Word
Fri Dec 12 15:54:37 CST 2003

G'day "zSplash" <zNOSPAMSplash@ gci.net>,

set a reference to the add-in with VBE > Tools References first...



"zSplash" <zNOSPAMSplash@ gci.net> was spinning this yarn:

>I am trying to set 2 keys on the keyboard to run code from MyAddin, on the
>server. I've tried the following unsuccessfully. (See the commented-out
>code for what I also tried.) How can I reference an Addin when defining a
>key?
>
>Sub setKeys()
> Dim myAddin As AddIn
> Set myAddin = "g:\myAddin.dot" '"myAddin.dot"
> CustomizationContext=NormalTemplate
> KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
> wdKeyCategoryMacro, Command:="time" 'myAddin.time"
> CustomizationContext = NormalTemplate
> KeyBindings.add KeyCode:=BuildKeyCode(wdKeyInsert), KeyCategory:= _
> wdKeyCategoryMacro, Command:="Send"
>End Sub
>
>TIA
>

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.

Re: define keys to run Addin code by zSplash

zSplash
Fri Dec 12 16:21:12 CST 2003

Thanks, wHeretic. I tried setting a reference to it (using Browse), but
only library files are shown. I guess my question now is: Am I supposed to
be saving my Addin (now a .dot file) as a .olb (or some libary extension)?
If so, how to do that?

st.

"Word Heretic" <myname@wordheretic.com> wrote in message
news:28ektvg2gaadgj3a7vl70o3t31cggdsmov@4ax.com...
> G'day "zSplash" <zNOSPAMSplash@ gci.net>,
>
> set a reference to the add-in with VBE > Tools References first...
>
>
>
> "zSplash" <zNOSPAMSplash@ gci.net> was spinning this yarn:
>
> >I am trying to set 2 keys on the keyboard to run code from MyAddin, on
the
> >server. I've tried the following unsuccessfully. (See the commented-out
> >code for what I also tried.) How can I reference an Addin when defining
a
> >key?
> >
> >Sub setKeys()
> > Dim myAddin As AddIn
> > Set myAddin = "g:\myAddin.dot" '"myAddin.dot"
> > CustomizationContext=NormalTemplate
> > KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
> > wdKeyCategoryMacro, Command:="time" 'myAddin.time"
> > CustomizationContext = NormalTemplate
> > KeyBindings.add KeyCode:=BuildKeyCode(wdKeyInsert), KeyCategory:= _
> > wdKeyCategoryMacro, Command:="Send"
> >End Sub
> >
> >TIA
> >
>
> Steve Hudson
>
> Word Heretic, Sydney, Australia
> Tricky stuff with Word or words for you.
> wordheretic.com
>
> If my answers r 2 terse, ask again or hassle an MVP,
> at least they get recognition for it then.
> Lengthy replies offlist require payment.



Re: define keys to run Addin code by Steve

Steve
Sun Jan 11 16:27:49 CST 2004

G'day "zSplash" <zNOSPAMSplash@ gci.net>,

is this still outstanding? Sorry for the delay - silly season, moved
house & ISPs etc.


"zSplash" <zNOSPAMSplash@ gci.net> was spinning this yarn:

>Thanks, wHeretic. I tried setting a reference to it (using Browse), but
>only library files are shown. I guess my question now is: Am I supposed to
>be saving my Addin (now a .dot file) as a .olb (or some libary extension)?
>If so, how to do that?
>
>st.
>
>"Word Heretic" <myname@wordheretic.com> wrote in message
>news:28ektvg2gaadgj3a7vl70o3t31cggdsmov@4ax.com...
>> G'day "zSplash" <zNOSPAMSplash@ gci.net>,
>>
>> set a reference to the add-in with VBE > Tools References first...
>>
>>
>>
>> "zSplash" <zNOSPAMSplash@ gci.net> was spinning this yarn:
>>
>> >I am trying to set 2 keys on the keyboard to run code from MyAddin, on
>the
>> >server. I've tried the following unsuccessfully. (See the commented-out
>> >code for what I also tried.) How can I reference an Addin when defining
>a
>> >key?
>> >
>> >Sub setKeys()
>> > Dim myAddin As AddIn
>> > Set myAddin = "g:\myAddin.dot" '"myAddin.dot"
>> > CustomizationContext=NormalTemplate
>> > KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
>> > wdKeyCategoryMacro, Command:="time" 'myAddin.time"
>> > CustomizationContext = NormalTemplate
>> > KeyBindings.add KeyCode:=BuildKeyCode(wdKeyInsert), KeyCategory:= _
>> > wdKeyCategoryMacro, Command:="Send"
>> >End Sub
>> >
>> >TIA
>> >
>>
>> Steve Hudson
>>
>> Word Heretic, Sydney, Australia
>> Tricky stuff with Word or words for you.
>> wordheretic.com
>>
>> If my answers r 2 terse, ask again or hassle an MVP,
>> at least they get recognition for it then.
>> Lengthy replies offlist require payment.
>

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.