Installing a macro

R

RyanF

I've written a macro for Word which multiple people would like to have
installed on their office and personal machines. In some cases, bringing
their personal machines to me would be inconvenient for them, and travelling
to their residence is an awkward option at best. In these cases, I would
like to provide them a way to easily and painlessly install my macro (one or
two-click installation, not a 13 step process of manually installing it in
Word). Is there such a way to create a macro installation file, and if so,
how?
 
G

Graham Mayor

Copy it to a template and instruct the user to save the template in the Word
startup folder.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
R

RyanF

I'm actually pretty new to this; this is the first macro that I've written.
It is intended to be available in all new Word documents, so I've been
importing it under "Normal" in the VB editor so far. I don't want to hand
someone my "Normal.dot" template and have it overwrite anything useful in
their own, so could you elaborate a bit on what your instructions meant?

Also, to take this a step further: my current implementation includes
creating a button for the macro on a toolbar (Standard or Quick Access,
depending on which version of Office they have) and assigning a shortcut key
to the macro as well. How difficult would it be to automate these tasks for
the user as well so I don't have to give them a difficult set of instructions
to follow?
 
F

fumei via OfficeKB.com

Exactly as it was posted.

Copy the code to a new file, save that file as a template (.dot), and have
them put it in their Startup folder.

These are called global templates, and you really should put your own code in
one as well.

It is not a good idea to put code in normal.dot. Even Microsoft suggests not
doing that. Normal.dot is easily corrupted.

"so I've been importing it under "Normal" in the VB editor so far"

What do you mean "importing"?????
I'm actually pretty new to this; this is the first macro that I've written.
It is intended to be available in all new Word documents, so I've been
importing it under "Normal" in the VB editor so far. I don't want to hand
someone my "Normal.dot" template and have it overwrite anything useful in
their own, so could you elaborate a bit on what your instructions meant?

Also, to take this a step further: my current implementation includes
creating a button for the macro on a toolbar (Standard or Quick Access,
depending on which version of Office they have) and assigning a shortcut key
to the macro as well. How difficult would it be to automate these tasks for
the user as well so I don't have to give them a difficult set of instructions
to follow?
Copy it to a template and instruct the user to save the template in the Word
startup folder.
[quoted text clipped - 7 lines]
 
R

RyanF

What do you mean "importing"?????

I open up Word. I click on the Tools menu, then Macro, then Visual Basic
Editor. (http://img149.imageshack.us/my.php?image=screen1iw4.png)

I select and expand "Normal" in the Project Explorer. I click on the File
menu, then "Import File...", and then I import my file, "MyMacro.bas".
(http://img180.imageshack.us/my.php?image=screen2cr8.png)

My macro then appears under the "Modules" folder under "Normal".
(http://img181.imageshack.us/my.php?image=screen3dx3.png)

This is the only way that I knew how to do this so that all new documents
would have access to the Macro. If I am doing something my way that could be
done in an easier, safer, or more secure way, please let me know, with
instructions. Assume that I know nothing about Microsoft Word or VBA
programming to avoid unnecessary questions. I am very interested in learning
the details of "why" and "how", so please explain as much as necessary.

Also, when I set this up for users now, I also add a button and assign a
shortcut key for the macro. Is there a way to do this short of creating an
installer? If I had to create an installer, where can I find instructions on
how to create such an installer (specifically, instructions on how to
install/integrate things into Word).

Thanks for all your help so far!


fumei via OfficeKB.com said:
Exactly as it was posted.

Copy the code to a new file, save that file as a template (.dot), and have
them put it in their Startup folder.

These are called global templates, and you really should put your own code in
one as well.

It is not a good idea to put code in normal.dot. Even Microsoft suggests not
doing that. Normal.dot is easily corrupted.

"so I've been importing it under "Normal" in the VB editor so far"

What do you mean "importing"?????
I'm actually pretty new to this; this is the first macro that I've written.
It is intended to be available in all new Word documents, so I've been
importing it under "Normal" in the VB editor so far. I don't want to hand
someone my "Normal.dot" template and have it overwrite anything useful in
their own, so could you elaborate a bit on what your instructions meant?

Also, to take this a step further: my current implementation includes
creating a button for the macro on a toolbar (Standard or Quick Access,
depending on which version of Office they have) and assigning a shortcut key
to the macro as well. How difficult would it be to automate these tasks for
the user as well so I don't have to give them a difficult set of instructions
to follow?
Copy it to a template and instruct the user to save the template in the Word
startup folder.
[quoted text clipped - 7 lines]
step process of manually installing it in Word). Is there such a way
to create a macro installation file, and if so, how?
 
D

Doug Robbins - Word MVP

See the article "Distributing macros to other users" at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

RyanF said:
What do you mean "importing"?????

I open up Word. I click on the Tools menu, then Macro, then Visual Basic
Editor. (http://img149.imageshack.us/my.php?image=screen1iw4.png)

I select and expand "Normal" in the Project Explorer. I click on the File
menu, then "Import File...", and then I import my file, "MyMacro.bas".
(http://img180.imageshack.us/my.php?image=screen2cr8.png)

My macro then appears under the "Modules" folder under "Normal".
(http://img181.imageshack.us/my.php?image=screen3dx3.png)

This is the only way that I knew how to do this so that all new documents
would have access to the Macro. If I am doing something my way that could
be
done in an easier, safer, or more secure way, please let me know, with
instructions. Assume that I know nothing about Microsoft Word or VBA
programming to avoid unnecessary questions. I am very interested in
learning
the details of "why" and "how", so please explain as much as necessary.

Also, when I set this up for users now, I also add a button and assign a
shortcut key for the macro. Is there a way to do this short of creating
an
installer? If I had to create an installer, where can I find instructions
on
how to create such an installer (specifically, instructions on how to
install/integrate things into Word).

Thanks for all your help so far!


fumei via OfficeKB.com said:
Exactly as it was posted.

Copy the code to a new file, save that file as a template (.dot), and
have
them put it in their Startup folder.

These are called global templates, and you really should put your own
code in
one as well.

It is not a good idea to put code in normal.dot. Even Microsoft suggests
not
doing that. Normal.dot is easily corrupted.

"so I've been importing it under "Normal" in the VB editor so far"

What do you mean "importing"?????
I'm actually pretty new to this; this is the first macro that I've
written.
It is intended to be available in all new Word documents, so I've been
importing it under "Normal" in the VB editor so far. I don't want to
hand
someone my "Normal.dot" template and have it overwrite anything useful
in
their own, so could you elaborate a bit on what your instructions meant?

Also, to take this a step further: my current implementation includes
creating a button for the macro on a toolbar (Standard or Quick Access,
depending on which version of Office they have) and assigning a shortcut
key
to the macro as well. How difficult would it be to automate these tasks
for
the user as well so I don't have to give them a difficult set of
instructions
to follow?

Copy it to a template and instruct the user to save the template in
the Word
startup folder.
[quoted text clipped - 7 lines]
step process of manually installing it in Word). Is there such a
way
to create a macro installation file, and if so, how?
 

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

Top