PDA

View Full Version : Solved: Does Word Have a Personal?



Cyberdude
09-15-2005, 09:28 AM
I started fooling around with macros in Word for the first time, and I was wondering if there is anything in Word comparible to Personal.xls in Excel? http://vbaexpress.com/forum/images/smilies/119.gif

Jacob Hilderbrand
09-15-2005, 09:54 AM
Normal.dot

MWE
09-15-2005, 10:13 AM
Normal.dot

Does this mean that the macros in Personal.xls are abnormal or that the macros in Normal.dot are impersonal?

One does wonder why Mr Gates seems unable standardize names and conventions across his programs.:banghead::banghead:

MOS MASTER
09-15-2005, 02:54 PM
Yes Mark...Bill works in misterious ways! :rofl:

To the Dude:

Short explanation.

Normal is indeed the same as Personal with the difference that it's always loaded. (Personal only loads when you've used it for the first time)

You can use Addins in Word too (Global Templates) these *dot files are loaded globaly from Word or Office Startup and they behave simular to *xla files of Excel.....(So the code is available)

HTH, :whistle:

fumei
09-15-2005, 11:56 PM
I would like to add that it is a very good idea to NOT put your macros in Normal.dot. Normal.dot is the defauilt location for macros, but even Microsoft does not recommend it.

Normal.dot is REQUIRED - although 2003 seems a little off kilter on this.

What corrupts normal.dot is all the I/O involved, so anything that lessens that is a good thing. As Joost hinted at, make a new global template file - call it...MyCode.Dot. Start storing your routines and macros in their. If you have it load globally, the macros will be accessible for all documents. This keeps normal.dot cleaner.

Brandtrock
09-16-2005, 01:14 AM
I would like to add that it is a very good idea to NOT put your macros in Normal.dot. Normal.dot is the defauilt location for macros, but even Microsoft does not recommend it.

Normal.dot is REQUIRED - although 2003 seems a little off kilter on this.

What corrupts normal.dot is all the I/O involved, so anything that lessens that is a good thing. As Joost hinted at, make a new global template file - call it...MyCode.Dot. Start storing your routines and macros in their. If you have it load globally, the macros will be accessible for all documents. This keeps normal.dot cleaner.

My wife's employer puts all of their code in Normal.dot for their employee review form. Then they wonder why they always have problems. :bug:

Perhaps I'll put a bug in her ear to see if they can change to a global template to see if that helps.

Thanks for the info Fumei

sheeeng
09-16-2005, 01:46 AM
Yes Mark...Bill works in misterious ways! :rofl:

To the Dude:

Short explanation.

Normal is indeed the same as Personal with the difference that it's always loaded. (Personal only loads when you've used it for the first time)

You can use Addins in Word too (Global Templates) these *dot files are loaded globaly from Word or Office Startup and they behave simular to *xla files of Excel.....(So the code is available)

HTH, :whistle:

Indeed...

Also, Mark. I don't really know Gates, but he is main driving force in making computer software technologies invaded all areas in our life.

Cyberdude
09-16-2005, 01:07 PM
Thanx for all the great replys. It really cleared up things in my mind (although my sinuses are still a little clogged). Making the transition from Excel macros to Word macros looks like it'll be a daunting experience. http://vbaexpress.com/forum/images/smilies/beerchug.gif
Sid

MWE
09-16-2005, 04:15 PM
...

You can use Addins in Word too (Global Templates) these *dot files are loaded globaly from Word or Office Startup and they behave simular to *xla files of Excel.....(So the code is available)

HTH, :whistle:
I have never been able to get global templates to work. No matter what I try, when I attempt to "open" the template in the VBE, I get an error message stating "Project is not viewable". So I continue to use Normal.dot with all its problems.

The only way I can see what is inside a global template is if I click on it from a file manager program and open Word. Word opens with a new document; when I attempt to open the global template in the VBE, I can get in. But, as above, if I open Word any other way and try to open the global template, I get the not viewable error.

What might be wrong?

MOS MASTER
09-16-2005, 04:30 PM
Thanx for all the great replys. It really cleared up things in my mind (although my sinuses are still a little clogged). Making the transition from Excel macros to Word macros looks like it'll be a daunting experience. http://vbaexpress.com/forum/images/smilies/beerchug.gif
Sid

Glad we could help! :beerchug:

MOS MASTER
09-16-2005, 04:33 PM
I have never been able to get global templates to work. No matter what I try, when I attempt to "open" the template in the VBE, I get an error message stating "Project is not viewable". So I continue to use Normal.dot with all its problems.[/vba]

True it is this way by design! I would much rather have it the way it works in XL with xla file but the behaviour you're getting is normal. :(

[code]
The only way I can see what is inside a global template is if I click on it from a file manager program and open Word. Word opens with a new document; when I attempt to open the global template in the VBE, I can get in. But, as above, if I open Word any other way and try to open the global template, I get the not viewable error.

What might be wrong?
The only way to get in to the addins code is by right clicking the TEMPLATE and choose open. It is now opened as Template. (Double clicking opens a new document based on that template. (And even this can differ between Word versions)

So the template has to be opened as a template to get in to the code so Yes it's not the most easy way and I have no idea why they made it this way but we have to cope with what we have been giving.

I'm used to it by now...but I understand and agree the EXCEL method is better! :yes

TonyJollans
09-16-2005, 04:36 PM
In the ThisDocument module in your global template create a sub:

Sub OpenMe()
Documents.Open Me.FullName
end sub

It doesn't matter what you call it. It will open the global template for editing.

Optionally, assign this to a toolbar icon or shortcut key and then you can easily run it when you want to edit macros. Optionally, also, you could add another macro to close it when you'd finished editing.

MOS MASTER
09-16-2005, 04:42 PM
In the ThisDocument module in your global template create a sub:

Sub OpenMe()
Documents.Open Me.FullName
end sub


I still use the right click method but I can see this sub's potential if you have to edit a lot.

You could use the OpenAsDocument method as well to get the same result. :yes

fumei
09-17-2005, 10:26 AM
1. Global templates are just like any other file. It must be explicitly opened to access the contents of the file; either the contents of the document part of the template, or the code modules. Otherwise, the project is "unviewable".

2. Gloabl templates loaded as global do NOT load the file. Word parse the code modules and builds a pointer to the routines. This is why you can load the actual file (even while it is loaded as a global template), edit the code, and once saved the code changes/additions are immediately available.

3. The best way is to make amacro button (icon) on a tollbar that explicitly loads the global template file. That way, if you need to edit it, you can get iyt easily.

4. Gloabl templates can be in ANY folder, not just the Templates folders under Options.

5. Globals are loaded via Templates and Addins.

They are still the BEST place to put code.

gmaxey
09-17-2005, 10:35 AM
Gerry,

I would certainly follow your advice if I knew of a way to eliminte the Project Locked problem associated with any project template except for Normal. I like to be able to access my code in the VBE without having to specidically open the template. That is the convienience of Nomal.Dot that I am just not willing to give up.

fumei
09-17-2005, 10:51 AM
Then you are stuck, because the ONLY Project that is always accessible is Normal. Oh, and any other Document in the current Documents collection.

The Project is locked because, as stated, globals do NOT open the file, they parse the code modules and build a hidden collection of pointers to them.

I am sure you have a reason for wanting to never load a code containing file, but I can not see what that would be. At least a reason large enough to avaoid the potential corruption of normal.dot.

My global has thousands of lines of code in it. I am CONSTANTLY making changes to it - ading stuff, corrrecting stuff. Part of the global adds a icon to the Standard toolbar, which loads the actual file. I need to work on it, I click the button......I can now work on it. When I am done I simply save and close it.

I would be interested in knowing precisely the difficulties this causes.

Other than that....yup, you are gonna use Normal.dot.

The other advatange of a code containing global is that it is easily sent to anyone else. This file, BECAUSE it is not normal.dot can be:

1. placed in any folder, thus avoiding the location requirement of either normal.dot, or other document creation templates;
2. loaded either globally automatically, or by Word session

gmaxey
09-17-2005, 01:06 PM
Gerry,



Thanks for your reply.



I don't consider myself "stuck" actually. Stuck conjures thoughts of being in a bad situation, condition, or place with no way out. I have several global templates (containing) code that load automatically each time I start Word and I routinely open individual documents that contain code. The global templates contain code that I used, but rarely want to look at. It is not that I don't want to load files containing code; it is that I like the convenience of having code in Normal.Dot with immediate access from within the VBE. From my perspective you are the one that is "stuck" with opening the global template file, then selecting that project, then remembering to save it when you are done. :-)



Part of my resistance to moving code out of Normal.Dot is the convenience and perhaps good fortune. While I don't know what the future holds, I have been storing code in Normal.Dot for several years and I have never had problems with corruption.



Actually neither of us is stuck. We just have different preferences. I certainly agree with your advice and would recommend it. I just don't follow it.

MOS MASTER
09-17-2005, 06:00 PM
1. Global templates are just like any other file. It must be explicitly opened to access the contents of the file; either the contents of the document part of the template, or the code modules. Otherwise, the project is "unviewable".

Very true buddy...that's why I'd love Bill's Word team to change it to the way it works in Excel! :yes



2. Gloabl templates loaded as global do NOT load the file. Word parse the code modules and builds a pointer to the routines. This is why you can load the actual file (even while it is loaded as a global template), edit the code, and once saved the code changes/additions are immediately available.


Yups that's why we need a handy little macro like Tony to open them first to edit...(Or like me just use the right click option..don't edit that much when I've started)



3. The best way is to make amacro button (icon) on a tollbar that explicitly loads the global template file. That way, if you need to edit it, you can get iyt easily.

Sounds interesting but I don't understand this one!

I know how to load a addin to my projects but that doesn't make the code available!! (Works just like loading via Templates and Addins)

Only way I know is to open the template....

So tell me buddy what do you mean.



4. Gloabl templates can be in ANY folder, not just the Templates folders under Options.


Very true but they have to be loaded by hand or by code that manner.

For the record:
Templates in the Templates are NOT loaded globaly by Word startup!!
Only Normal.dot from that folder is. (If it is there....)

Global templates loaded on startup should be in the Startup Folder of Word or Office!



They are still the BEST place to put code.

This is my preferred method as well! :thumb

MOS MASTER
09-17-2005, 06:02 PM
That is the convienience of Nomal.Dot that I am just not willing to give up.

Amen to that Greg....but I suggest you make a copy once in a while cause Normal corruption has happend to me many times...(If I'm trying out stuff)

Loosing your code is not funny if you put all that work in it....:whistle:

gmaxey
09-17-2005, 06:38 PM
Amen to that Greg....but I suggest you make a copy once in a while cause Normal corruption has happend to me many times.


Copying Normal.Dot is the one file I back up with the same frequency of my financial data :-)

MOS MASTER
09-17-2005, 06:45 PM
Copying Normal.Dot is the one file I back up with the same frequency of my financial data :-)

Hahaha I never touch that stuff! :rofl: (Financial Data...scary stuff)

fumei
09-19-2005, 06:53 AM
I am not sure I understand what you did not understand.

If you have a .DOT in Startup, the routines and ptrocedures in that .DOT are available globally. The file however, is NOT loaded. The routines and procedures are parsed and pointers created for them.

I simply have a button on the toolbar that specifically opens the .DOT file. I click it, the file loads, and I can edit the code in it. As soon as it is saved, Word parses the code modules again, and recreates the pointers to them. Therefore the edited code is immediately available. The .DOT file can be closed.

When you state the code is not available, I take it you mean the code that can be edited, as opposed to the code that can be run.

MOS MASTER
09-20-2005, 03:35 PM
I simply have a button on the toolbar that specifically opens the .DOT file. I click it, the file loads, and I can edit the code in it.

Hi Buddy,
:yes
The question was, what yo meant with this:

3. The best way is to make amacro button (icon) on a tollbar that explicitly loads the global template file. That way, if you need to edit it, you can get iyt easily.

But I see we both meant the same thing by your answer. To access the code the template neads to be opened!


So it was just a simple confusion from my side what you meant. :whistle: (I misunderstood the loading part...all clear now)