Thanks for the extra information - I hadn't taken in the issues with the
shortcut before.
I've just tested this here (Word 2003) with a quickly made sample .doc
made from a template with a complex AutoNew macro and I find I can New
from the document without problems, but the /t flag produces a "cannot
read file" error - so clearly there are indeed "bigger problems" with
differences between New and the /t flag - /t behaviour must be making some
assumptions that it is a template, I suppose.
Looks like the desktop shortcut with startup flags may be a cul de sac. If
separate shortcuts for each template really are essential (as opposed to
other methods like a menu of model documents or a UserForm to choose) then
maybe the only solution would be a matching set of dummy
templates/documents with Auto macros that simply New from the appropriate
.doc and close the dummy document? If you use a naming pattern it should
be possible to reduce maintenance so each dummy is simply a copy of a
master with the macro, just changing the filename?
Just thinking aloud here, maybe someone else will have a better idea or
understanding of the /t problem.
--
Margaret Aldis - Microsoft Word MVP
Syntagma partnership site:
http://www.syntagma.co.uk
rafraf said:
Preface: This turned out to be rather long, a lot of it explains my
motivation. Really, only the last paragraph addresses my core problem.
Again, thanks everyone for taking the time to reply to this. Still not
too familiar with this newsgroup system, so please excuse me if I don't
quote.
I am using this approach over global for three reasons: 1. a global is
still harder to maintain, 2. I want to minimize the intrution into
people's standard Word settings, and, 3, I want to use the same styles
universally. There is also a historical reason in that I wanted to use
a network folder rather than a script to disseminate the template, but
for various reasons we ended up doing the latter.
Like was said using {dot}->doc->{doc} approach means that anyone that
can use the template can create a template and that any number of
'templates' can be as easily maintained as one (and thanks to these
newsgroups, even headers and footers have been standardized and
centrelized). From an end user's point of view, it is completely
transparent and is no different from having multiple .dots.
The one problem is if you want to have things like a desktop/start menu
shortcut to a particular template. If you just had a shortcut to the
.doc, you will end up opening it rather than creating a new doc based
on it. So, to overcome this, I thought I would create shortcuts with
the instructions to open the doc as new. But this just does not work
well: The [wordexec /t"docpath\docname.doc] form of the shortcut
creates a document# out of the doc, but it is different in crucial ways
from both the context menu [new] (right click .doc file >click 'New')
and the File>New... dialog. The two differences are that my autonew
macro does not get executed (the macro executes a dialog to enter
document and custom document properties) and that I am prompted to save
changes to the template, the latter being the most problematic.
Some of the reasons mentioned here about why I would be told to save
the template are consistant with what I would expect, but I don't
believe any of them address why this problem **only** occurs when the
doc is opened through the [wordexec /t"docpath\docname.doc] shortcut
rather than through any other method available to me. This also may be
symptomatic of bigger problems (i.e. differences) between using the
shortcut and other approaches. I have read through Microsoft KB
articles on Word 2K startup switches, and only /t seems applicable, but
if anyone knows of another way of doing it, I would love to hear about
it.