Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Templates in Word Startup folder cannot be viewed

Status
Not open for further replies.

gtaborda

Programmer
May 13, 2007
75
GB
Hi

I have put a number of Templates in ...word\startup folder so they are opened and can be run when Word starts.

They seem to run ok HOWEVER when I try to access them via VBA window I get the message "the project cannot be shown/Viewed"

I am only able to open normal.dot template file.

Also if I put the same templates in ...microsoft\template\ folder, the same thing happens

Anyone knows how to solve this problem?

thanks in advance for your help
 
I have put a number of Templates in ...word\startup folder so they are opened and can be run when Word starts.
They are NOT opened.

Global templates (which is what they are) have their code modules available - so yes, their code can be run - but the files are NOT opened. Therefore the projects are not viewable.

Documents cloned from a template DO have the template project viewable.

What exactly is your problem? Why do you want to get the code modules? You have to open the file to get at the code. Or, clone a document from them, but in that case - if you are not using them for document creation - why bother? Just open the file. My globals (in Startup) have an button on a toolbar that actually opens the file.

faq219-2884

Gerry
My paintings and sculpture
 
Thanks for your input fumei

Note that what I want is to have access to all my .DOT VBA code from within the VBA Window.

I have copied normal.dot (from ..\template\) and copied it to ..microsoft\word\startup folder (under a different name)

However,although the code "seems to be there" when Word is opened (toolbar shows up, etc) what I want is to be able to change any of the code, just like I can with normal.dot

However I cannot and get the error I mentioned.


It is like in Excel, you have as many XLS files as you want in the ..\excel\startup folder. These all open up when you open Excel.

When you open the Excel VBA window, you can see all the XLS on the left hand side (Project) window AND you can also access the code in any of the XLS files.

I cannot do that in Word.



 
1. You should NOT use a renamed normal.dot file. Why are you doing that? Use a .dot file to hold your code. Although, I suppose renaming normal.dot is sort of OK, but why? VBA code should not go into normal.dot in the first place. Bad practice. I have thousands of lines of VBA code, of which less than 1% is in normal.dot.

2.
However,although the code "seems to be there" when Word is opened (toolbar shows up, etc) what I want is to be able to change any of the code, just like I can with normal.dot
The code IS there. And I have already explained why you can not do this.

Globals (in Startup) are not viewable, or editable. Unless the actual file is opened, with the one exception of the special global, normal.dot.

Documents with code in their template DO have the template code modules viewable/editable.

Bottom line, sorry, is that you can not edit the code in unopened global files. The code is accessible, but the modules are not. Word parses globals and sets up pointers to the procedures. This is why the procedures can be run.

faq219-2884

Gerry
My paintings and sculpture
 
Hi

1. I am copying normal.dot just as an example, nothing else.

2. Got it now, the startup "system" of Word doesn't work like Excel, where you do have the option to view the code of all templates in excel\startup folder at once.

I have opened the XXX.DOT file from Word and now I do have access to the code.

Thank you for your help !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top