Word 2003 Attached Templates

J

Jeff Hall

I have a problem that only affects Word 2003 VBA.

I want to close and re-open file that has macro running in its attached
template.

In all previous versions of Word (97+) I simply saved the file under a
temporary name and opened the original file again. Then I closed and
deleted the temporary file. Because the original file has the template
attached, the macro continues.

Under Word 2003, when the original file is re-opened, the macro fails with
Word error 1220 "Word cannot find or run the application"

Please help ... this is a fatal problem for any Word 2003 users!
 
C

Cindy M -WordMVP-

Hi Jeff,

Note that your posting is dated January 1, 1970, and may be the reason you
haven't gotten a response before. Many people sort messages with most recent
at the top...
Anyone got any idea?
Well, first off, I'd say that the macro originally ought not to have worked;
convenient that it did. But I get the impression someone closed a
programming loophole.

As a solution, you might have to move at least part of the macro (the one
that deals with "document management") into a global template. But you could
have the original macro load this; and call a macro in the attached template
to unload it.

Another possibility, seeing as how this is Word 2003, could be to pick up as
a string, using Document.Range.XML and write this into a plain text file.
Open it again in Word 2003 and it will be the same Word document; save that
as *.doc and you've got your copy, without having closed the original.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
J

Jeff

Thanks for the ideas Cindy.
Note that your posting is dated January 1, 1970,

I don't know why: this is what my mail reader shows:
NNTP-Posting-Date: Fri, 18 Jun 2004 20:27:13 +0000 (UTC)
Another possibility, seeing as how this is Word 2003, could be to pick up
as a string, using Document.Range.XML and write this into a plain text
file. Open it again in Word 2003 and it will be the same Word document;
save that as *.doc and you've got your copy, without having closed the
original.

Will this XML file still contain all the embedded and floating pictures and
internal structure (sections) and formatting?

I guess the same result would be achieved by opening a new blank document
and copying the whole story into it?

Jeff
 
C

Cindy M -WordMVP-

Hi Jeff,
I don't know why: this is what my mail reader shows:
NNTP-Posting-Date: Fri, 18 Jun 2004 20:27:13 +0000 (UTC)
Must have something to do with my newsreader... When I look at the header
informtion, I see the same as you do. But when I look at the "bar" where the
date is posted nice a black and bold, I see January 1, 1970. Ah, well, my
newsreader doesn't list in order of date, anyway :)
Will this XML file still contain all the embedded and floating pictures and
internal structure (sections) and formatting?
It certainly ought to, yes. For fun, try saving a test file as XML and take a
look said:
I guess the same result would be achieved by opening a new blank document
and copying the whole story into it?
Yes-and-no. If all you want is the main document story (as in the VBA meaning
of the term), then you could use doc.Range.FormattedText =
doc.Range.FormattedText. The problem comes if you want the entire document
(headers, footers, footnotes, etc.). Then, you can only get it by emulating
the user's Ctrl+A, Copy actions. This is also a bit risky, because you and the
user might conflict about who has what on the Clipboard :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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