Macros in Word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would be grateful if any one knows the answers to the following questions:

1. Is it possible to password protect macro's in templates and ultimately
any resulting documents built from these templates?

I am building a template with multiple macros (each adds a set sentence when
run) which users will use to create final word documents. I want to prevent
end users ammending the text of the setences.

2. Is there a known maximum number of macros that can be created to be run
by short cut keys?

3. Can the macros be stored in a separate file - rather than within the
template?

Thanks in advance

Andrew
 
Andrew Mercer said:
Hi,

I would be grateful if any one knows the answers to the following
questions:

1. Is it possible to password protect macro's in templates and ultimately
any resulting documents built from these templates?

You can set a password for the VBA project: in VBA, go to Tools > [Project]
properties and use the Protection tab. How much protection this provides is
debatable. If you really want to protect the code, write your app in
something that can be compiled. There is no way to protect the resulting
document that will prevent it a determined user from changing its content.
(You can password-protect the document, but that does nothing more than
discourage a malicious user.)

I am building a template with multiple macros (each adds a set sentence
when
run) which users will use to create final word documents. I want to
prevent
end users ammending the text of the setences.


2. Is there a known maximum number of macros that can be created to be run
by short cut keys?

There may be a physical limit, but you'll reach a practical limit long
before that: by definition, the user has to be able to remember the short
cuts (if they have to look them up, they're not longer shortcuts). If you've
got a large number of these sentences, shortcut keys are probably not the
way to go.
3. Can the macros be stored in a separate file - rather than within the
template?

Use an add-in.
 
Thanks - that was helpful however I have one further question - see below.

--
Andrew Mercer
-----------------


Jezebel said:
Andrew Mercer said:
Hi,

I would be grateful if any one knows the answers to the following
questions:

1. Is it possible to password protect macro's in templates and ultimately
any resulting documents built from these templates?

You can set a password for the VBA project: in VBA, go to Tools > [Project]
properties and use the Protection tab. How much protection this provides is
debatable. If you really want to protect the code, write your app in
something that can be compiled. There is no way to protect the resulting
document that will prevent it a determined user from changing its content.
(You can password-protect the document, but that does nothing more than
discourage a malicious user.)

I am building a template with multiple macros (each adds a set sentence
when
run) which users will use to create final word documents. I want to
prevent
end users ammending the text of the setences.


2. Is there a known maximum number of macros that can be created to be run
by short cut keys?

There may be a physical limit, but you'll reach a practical limit long
before that: by definition, the user has to be able to remember the short
cuts (if they have to look them up, they're not longer shortcuts). If you've
got a large number of these sentences, shortcut keys are probably not the
way to go.

I know my customer has a lot of sentences that will need macros they are
doing a similar thing with different software - and yes they do need a list
to remember the keys. They use the process to save having to write the same
sentences in multiple letters. However that is acceptable but they are now
wanting to transfer the same process to Word.

You suggest shortcut keys are not the way to go - what would you suggest
instead other than having to find the required macro each time via Tools ->
Macro -> ...
Use an add-in.

Thanks Andrew
 
Andrew said:
Thanks - that was helpful however I have one further question - see
below.

I know my customer has a lot of sentences that will need macros they
are doing a similar thing with different software - and yes they do
need a list to remember the keys. They use the process to save having
to write the same sentences in multiple letters. However that is
acceptable but they are now wanting to transfer the same process to
Word.

You suggest shortcut keys are not the way to go - what would you
suggest instead other than having to find the required macro each
time via Tools -> Macro -> ...

I wouldn't use macros at all for this, but autotext saved in the document
template. This creates its own list.

FWIW GhostTyper XML ( a third party application) would extend this ability
to any application that accepts keyboard input. I use it to store repeated
texts, links etc for use in these newsgroups.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
I know my customer has a lot of sentences that will need macros they are
doing a similar thing with different software - and yes they do need a
list
to remember the keys. They use the process to save having to write the
same
sentences in multiple letters. However that is acceptable but they are now
wanting to transfer the same process to Word.

You suggest shortcut keys are not the way to go - what would you suggest
instead other than having to find the required macro each time via
Tools ->
Macro -> ...

There are many ways you could approach this. There's no 'best' solution --
it depends on what the users are doing, how they choose to work, the nature
of the sentences and the kinds of choices they make in selecting them.

1. You don't need a separate macro for each possible sentence: by the sounds
of it, you want one macro and a choice of sentences. If all you're doing is
inserting sentences, you don't really need a macro at all (although a macro
might still be the best way to go).

2. You could use AutoText entries, with the user selecting from the list
thereof.

3. You could use a UserForm with one or more drop-down lists.

4. You could use a custom toolbar with a set of menus and sub-menus, with
each menu option linked to a macro or to an autotext entry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top