N
NoDakDame (Kathy Koppinger)
I suspect there is not a way to do this but I'll ask anyway.
I'm working on a large application in Word that among other things,
inserts SGML tags. I have a list of 432 standard tags that can be
inserted into the document. So far I have avoided having to hard code
the list of tags into the code by having a text file with the list of
tags. That way I can retrieve the names of the tags and pass them as
arguments to the different subroutines that insert the tags. I was
able to do this when applying tags using toolbar buttons (by setting
the parameter of the toolbar button and retrieving it in the sub that
applies the tag) and also in a user form that presents the user with a
listbox with all the tags in it.
However, I've now hit a wall. They need to be able to apply tags using
keyboard shortcuts. There are the issues I've found:
1. I can't assign a macro that takes an argument (even if it's
optional) to a keyboard shortcut.
2. I can't seem to discover which keyboard shortcut fired the
subroutine.
3. There is a CommandParameter argument when adding a keybinding,
however, it doesn't appear to do what I need. (It's used when
assigning a command such as FontSize to a shortcut to specify what
size.)
At this point the only way I can see to do this would be to create a
subroutine for each tag (all 432 of them) that would simply call the
macro that inserts the tag passing the name of the tag to it.
What is particularly annoying is that I've given the users the ability
to create custom tags on the fly for those rare cases where there is
not an appropriate standard tag. They want to be able to assign
shortcut keys to these also but if I can't use a generic macro to
insert the tag by passing the tag name, this isn't going to happen.
Thanks for your time!
KathyK
Grand Rapids, MI
--
Kathy
*****
"Use what talent you possess: the woods would be very silent if no birds sang except those that sang best."
-Henry Van Dyke (1852-1933) American scholar, educator, lyricist
I'm working on a large application in Word that among other things,
inserts SGML tags. I have a list of 432 standard tags that can be
inserted into the document. So far I have avoided having to hard code
the list of tags into the code by having a text file with the list of
tags. That way I can retrieve the names of the tags and pass them as
arguments to the different subroutines that insert the tags. I was
able to do this when applying tags using toolbar buttons (by setting
the parameter of the toolbar button and retrieving it in the sub that
applies the tag) and also in a user form that presents the user with a
listbox with all the tags in it.
However, I've now hit a wall. They need to be able to apply tags using
keyboard shortcuts. There are the issues I've found:
1. I can't assign a macro that takes an argument (even if it's
optional) to a keyboard shortcut.
2. I can't seem to discover which keyboard shortcut fired the
subroutine.
3. There is a CommandParameter argument when adding a keybinding,
however, it doesn't appear to do what I need. (It's used when
assigning a command such as FontSize to a shortcut to specify what
size.)
At this point the only way I can see to do this would be to create a
subroutine for each tag (all 432 of them) that would simply call the
macro that inserts the tag passing the name of the tag to it.
What is particularly annoying is that I've given the users the ability
to create custom tags on the fly for those rare cases where there is
not an appropriate standard tag. They want to be able to assign
shortcut keys to these also but if I can't use a generic macro to
insert the tag by passing the tag name, this isn't going to happen.
Thanks for your time!
KathyK
Grand Rapids, MI
--
Kathy
*****
"Use what talent you possess: the woods would be very silent if no birds sang except those that sang best."
-Henry Van Dyke (1852-1933) American scholar, educator, lyricist