Custom TaskPanes

C

Cindy M.

Hi Jan,
This is far worse. Actually the files which I open and which uses the
template are in WordML, so I expect them to be openeed at least in 2003
version. ;-) However as a developer I have the responsibility for this and
if you know how can I close it explicitly when it is not needed, I will do
it.
That would involve automating the Word application. Not everyone who is
working from a web interface does this :) If are maintaining contact to the
Word application after opening the document, then declare and instantiate an
object variable of the type Word.Document and set it to the template you're
opening as a document. (And then use this object with .AttachedTemplate)

If you can't do it that way, but can link up to Word at a later point, then
you can loop through the Documents collection, checking some property (name
or path, for example). When you find it, just use the Close method.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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

Jan Kucera

Hi Cindy,

Cindy M. said:
Hi Jan,

That would involve automating the Word application. Not everyone who is
working from a web interface does this :) If are maintaining contact to
the
Word application after opening the document, then declare and instantiate
an
object variable of the type Word.Document and set it to the template
you're
opening as a document. (And then use this object with .AttachedTemplate)

I like clean things. ;-) (and I don't like web interface :)). I am not sure
I understand what you meant, but I open the document through VBScript so I
have app variable, the document variable and I can have the variable that
holds template, which I use to set .AttachedTemplate of the document
variable (at the moment I use .AttachedTemplate = Documents.Open). However
how can I find when to close it if this is necessary?

Thanks,
Jan
 
C

Cindy M.

Hi Jan,
However
how can I find when to close it if this is necessary?
That is, indeed, the question... And I'm afraid I don't
have a good answer for you, since I doubt you can rely on
events from the web interface? (So you could get
DocumentBeforeClose and check whether your document is
being closed and then close the template-opened-as-a-doc as
well.)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
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

Jan Kucera

Hi,
I am not sure about the events, but I think that it might work when
rewritten to Javascript (I don't think I could use AddressOf in
VBScript...).

I wonder how critical this really is in 2003 version? (since I do not
revert to last saved copy, I can imagine the template document I'm attaching
is loaded only once).

Thanks, Jan.
 

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