Installing macro process using word 2000

C

constance

Hi everybody,
I have few questions :
I created new macros and new userforms in the normal projet in order to
execute my macros with all the documents opened in word.

* can you tell me where on my disk are my macro and userforms saved and
how i can retrieve it ?

* does the user necessarily need to go in the VB window to import a new
version of my macros or can it be done another way ?

* is it possible to do a script to install automatically my macros and
userforms in a directory specified by the user ?

* what is an add-in ? woild it be helpful in my case ?

thank you very much for your help
Lyne
 
J

Jezebel

constance said:
Hi everybody,
I have few questions :
I created new macros and new userforms in the normal projet in order to
execute my macros with all the documents opened in word.

* can you tell me where on my disk are my macro and userforms saved and
how i can retrieve it ?

Inside normal.dot. This is OK (just) on your own computer, but it's bad
practice and bad manners to make changes to users' copies of normal.dot.
Your code should be in a file of its own (eg some other template)

* does the user necessarily need to go in the VB window to import a new
version of my macros or can it be done another way ?

They can use the Organiser to copy macros from one document or template to
another. However your VB project may have other components, that won't be
copied this way.
* is it possible to do a script to install automatically my macros and
userforms in a directory specified by the user ?

Yes but it's fairly tricky to code and bloody impossible to manage as a
distribution task.
* what is an add-in ? woild it be helpful in my case ?

An add-in is a template (a .dot file) in the Word start-up folder (check
Tools > Options > File locations to find this). Word automatically loads any
templates in this folder -- you'll see them listed on the Tools > Templates
and Add-ins dialog. Your users can run any code or forms in these templates
in the same way as code in the normal project. This is probably the best
approach for what you're trying to do. To distribute a change to your macros
you simply send out a new copy of your add-in file. There's no installation
required other than saving it in the right place.
 
C

constance

Hi,
thank you all very much for your answers
I looked at the Templates and ass_ins dilaog in word 2000. The
files I choose need to be .dot files but as far i'm concerned, I have
a .bas file, 2 .frm files which are my userforms and 2 .frx files whic
are the associated code to my userforms and 2.txt files to lod the lis
boxes of my userforms.
Is it possible to do add ins with that cause when i try to load thos
files in the add-ins dialog, I hae an error who says "Impossible t
open this file".

Thanx for your hel
 
J

Jay Freedman

The add-in must be a template (.dot) file, that's correct. You will have to
save the macro (.bas file) and the userforms (.frm and .frx files) in that
..dot file before you load it. Here are the steps:

- Create a new template (File > New, select the Template radio button) and
save it with the name you want.
- Open the VBA editor.
- If you don't see the Project pane, select View > Project Explorer.
- Right-click the TemplateProject item for your template, and select Import
File.
- Find the .bas file and double-click it. Repeat for the .frm files (the
..frx files with the same names will be loaded automatically). The macros
from the .bas file will be placed in a module, and the userforms from the
..frm/.frx files will be placed in the Forms group.
- Save the template.

Now you can put the template in Word's Startup folder or load it through the
Templates and Add-Ins dialog.
 
C

constance

Hi Jay i tried to follow your instructions but I have an error messag
saying that the disk is full when I want to import the last userform.
don't understand this error because I have space on my c:\ drive
I put the message error as an attachment
nce I will succeed to build my templacet, can you tell me hwo t
execute it

Thnak very much

Constanc

File Attached: http://www.WordForums.com.com/forums/attachment.php?postid=44085 (errormsg.gif
 

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