Solved

VBA (Word) Exporting

Posted on 2004-08-16
7
299 Views
Last Modified: 2010-05-02
Hi Guys,
I have a nifty VBA Macro in WORD.  I would like to move it to another computer.  But, when I do this I have to go thru these steps:
1. Create a new macro.
2. Cut and paste the functionality into it from my original macro.
3. Create toolbar shortcuts to the macro.
4. Reference an icon for the toolbar shortcut.

Here's my question:

Is there a better way to import/export a VBA macro? Maybe like using a batch file to do all this for me so I don't have to go thru this hassle on every computer I want the macro on?
0
Comment
Question by:Jas001
  • 4
  • 2
7 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 11811912
The usual way of doing this is to copy the template. If you put it in the Word StartUp folder, it will be loaded automatically.
0
 
LVL 2

Author Comment

by:Jas001
ID: 11811957
Will the template create the shortcuts as well?  And what folder would that be?  Is the file named the same as my macro?
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11813470
You save it in any template. Just copy the template on the target computer in the template forlder. Macro will be availabe on the ohther system now.

The shourtcut will not be exported by this method. I can;t help you on that further.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 11813817
What do you mean by a shortcut for your macro?
The usual way to allow the end user to call a Word macro is to create a command button using the 'Customize' dialogue, setting its macro as desired. This can be saved in the template. The new button will be available when the template is loaded.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 11814192
BTW,
I have been giving you the simple answer.
It is possible to move code bits on their own. We have been discussing it in this ongoing question:
http://www.experts-exchange.com/Applications/MS_Office/Word/Q_21087884.html#11779674
0
 
LVL 2

Author Comment

by:Jas001
ID: 11814550
GramSkan,
I think I'm missing something here:  

First, the shortcut is the button in the toolbar. You're saying it is contained in the .dot file as well?

Second, My macro is called "Test1" in the Normal.dot as listed in the Organize dialog of Macro.  There is no Normal.dot file.  So, what file do I need to migrate to the new computer to give them the macro and the toolbar button?

Thanks.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 300 total points
ID: 11815098
Why do you say there is no Normal.dot file? There always is. Even if you delete it, Word knows how to and does recreate it.

You can create a new template with another name. Go to File/New and accept the blank document to base it on the Normal.dot, but specify Template in the Frame at the bottom right.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now