Problem with Word 2007

T

Tim Christopher

Hi all.
I had developed a Word 2003 template with a new toolbar that ran a macro
(VB6) whenever it was clicked. Whenever I opened this file in Word 2003 it
worked well. Unfortunately there is no toolbar/macro recognised by Word 2007.
I then read that a way around this is to have this old template loaded
globally - by having it copied to the Word STARTUP folder in 'Documents and
Settings'. This meant that I needed to create a new Word 2007 document
(NEWDoc) in order to have access to the toolbar/macro, which I can live with,
BUT once this new document (NEWDoc) has been created, any time I want to open
it I have to ensure that the old template is copied to the correct place. Is
there any way to program this to happen when the I first create NEWDoc? I
would like to program this through VB6 outside of Word 2007. Is it possible
to create toolbars in 2007 as it was in 2003?

Thanks in advance

Tim Christopher
 
D

Doug Robbins - Word MVP

Anything that you had on a toolbar in Word 2003 will appear under the
Add-ins tab in Word 2007.

--
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, originally posted via msnews.microsoft.com
 
T

Tim Christopher

You're right Doug! Unfortunately I didn't explain myself properly.

What I should have said was that I had originally pre-prepared this old
template (complete with toolbar/macro) so that when the user clicked a button
in a VB6 application, a copy of the template was saved. In Word 2003 this
copy copied over all parts of the original template (toolbar/macro). In Word
2007 the toolbar is copied in the 'AddIns' but the macro is not. I checked in
the VB editor and there was no code. Is it a problem trying to save it as a
'.dot' file in 2007? My macro settings in Word 2007 are very low security. My
original macro consisted of a pop-up menu I created for the user when the
toolbar button was clicked. Would there be any other way of programmatically
copying all of the macro code from the old template into the VB editor of the
'.dot' file just created?(including the pop-up form).

Hope this helps.

Tim Christopher
 
G

Graham Mayor

In order to have macros available in a template in Word 2007, the template
must be saved in a format that will store macros. This can be DOT or DOTM
format. The default DOTX format, which is what I guess you have used, will
eliminate the macros. Word 2007 can save in any of these formats.

If the template is attached to the document, it doesn't have to be installed
as an add-in for the macros to be available (though it should be stored in a
trusted location).

It is not a good plan to work with very low macro security.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

Tim Christopher

Thanks again for the help. I played around with VB6 and discovered a way to
do what I want:

in VB6 I created a macro behind a command button that did the following:

-created a new Word document and saved it as my new template (NEW.dot)
-I then referenced the VIBE library and copied both my UserForm and a module
to the VB editor of NEW.dot
-I used an old macro that creates a menu item in NEW.dot (it appears in the
AddIns)

When I opened NEW.dot it contained the functionality I was after.

BUT I then discovered that it also had created a reference to the
Normal.dotm template in the VB editor (in 'References'), so every time I
create a NEW.dot it will append another menu item to the existing one. Is
there any way to stop this from happening? I suspect it has to do with
creating the reference to Normal.dotm.

Thanks again.

Tim Christopher
 
G

Graham Mayor

Are you still copying the templates to the startup folder? Don't!

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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