Thursday, July 27, 2006

Normal.dot Vs. Normal.dotM

I am not sure what is going on, and must investigate further.

I have useful macros in my Word97/2000/2003 Normal.dot. I have labeled it so because no matter which version I load, the Normal.dot runs just fine.

Word2007 loads a Normal.dotM which is, of course, a different file from my Normal.dot.

When I load Word2000 I am using my Normal.dot.

When I load Word2007 I am using my Normal.dotM.

The batch file for Word97/2000/2003 refreshes Normal.dot by copying it from a secure location (another anti-virus bulwark):

copy c:\SAFE\Normal080.DOT "c:\Templates\Normal.DOT"
call "C:\Program Files\Office2000\Office\winword.EXE"


A natural consequence of this is that no matter how much I modify Normal.dot, no matter I save the changes, they disappear on the next load. (Actually the batch file archives them, but that doesn’t affect the story).

The startup sequence in Normal.dot includes checking the Auto recovery data (Tools, Options, Save, “Save auto recover”) and modifying a toolbar button. The toolbar button shows an orange lozenge if Auto recover is set zero, otherwise shows a “1”. “5” or “10”, and clicking the button cycles me through “0”, “1”, “5” or “10” minutes respectively.

Further, if the value of “Save auto recover” is non-zero, the startup sequence alerts me with a message box.

This has been working for me for several years; I generally don’t trust Auto recover, and turn it on only when I am doing lengthy text entry.

Word2007, of course, doesn’t see my C:\Greaves\Admin\Templates\Normal.Dot, or at least, chooses not to, so in general I don’t see my lozenge available.

Whereas loading Word2000 shows the lozenge in residence:

Clicking the lozenge twice cycles me from zero through 1 to 5 minutes:

If I cycle through, the toolbar button image is changed, and so I am prompted to save Normal.dot:

And if I re-load Word2000 Normal.dot inspects the Save Auto recover value and re-fabricates the toolbar button (remember I always start with a fresh copy of Normal.dot) and issues an alert – in this case for 1 minute:

Here is the oddity: When I load Word2007, and hook in Normal.dot as an addin, Word2007 reports the save interval to be 10 minutes:

As well, the toolbar icon shows 10 minutes as the button caption – consistent with my message box, but inconsistent with what I know to be there!

(later)
?application.Options.SaveInterval

is the key to the problem.

I believe that Word saves the value of SaveInterval in the registry, under the infamous “Data” branch. That being so, each of my 4 versions of Word (97, 2000, 2003 and 2007) ought to exhibit different save values.

I put this to the test by setting SaveInterval to be 0, 1, 5 and 10 respectively in the four versions , and sure enough, checking the Auto recovery data (Tools, Options, Save, “Save auto recover”) in each version shows that it is so preserved.

My Normal Startup is working correctly.

If I want to set the SaveInterval in one version and have it carried over to the next version, I must perform some skullduggery with the registry from within my VBA code. And for this issue I would rather not do that here and now!

Wednesday, July 19, 2006

Setting Up

(You can read this post with images at http://www.chrisgreaves.com/Office2007developer/)

The first VBA macro I tried to run in Word2007 was my “Best Fit Toolbars By Name”. It crashed, probably because we don’t have command bars any more, we have ribbons.

So tonight I began peeking under the hood.

First step is to make use of Word2007’s interface to get to VBA; I can re-tool it as my own later.

It is once more into the Pearl, Word Options, Personalize and Show Developer Tab.

With that in place I record, run and review the typical “Hello World” macro.

Apart from that, everything else seems to be in place.

Sunday, July 16, 2006

Extra Purpose

You are probably aware that I have a parallel commentary based on my experiences as a end-user (Please see “Office 2007 for the end-user”). This blog goes beyond my use of Office 2007 as a desktop tool and extends into my special field of Rapid Application Development.

Rapid Application Development means here that I can build a complete and functional application with a user interface in anything from an hour to three days.
I make extensive use of libraries of code and Powerful Engines to achieve my goals.
In the period 1997 to 2006 I made use of Word’s VBA language to drive 95% of the developed applications, including document processors, spreadsheet and presentation manipulators, and specialized tasks such as cleaning up Notes History data in Act6! Contact management databases.

With 2007 I’ll continue to press for Rapid Application Development, but I’ll be seeing it through new eyes.

I expect I will migrate my existing libraries as quickly as possible so that I can focus on new applications in Office 2007 without having to rebuild each utility procedure from scratch.

This is the approach I adopted when migrating from Word’s WordBasic to Word97.

Saturday, July 08, 2006

This blog documents my day-by-day experiences as an application developer using the available Office2007 version.
You can contact me by telephone or email via http://www.chrisgreaves.com/contact.htm