A have a Word 2K solution where every bit of code is contained in a template
in the StartUp folder.
Everything works fine except when a user doubleclicks a word document in
Windows Explorer without having Word open.
Word returns the errormessage (4248) "This command is not available because
no document is open".
I guess its in the procedures for reading or writing values of custom
document properties the error happens (according to tech-net articles) but
I'm unable to ErrorHandle my way out of the problem.
Any suggestions.
Thanx in advance
Jesper
> I guess its in the procedures for reading or writing values of custom
> document properties the error happens (according to tech-net articles
That could be the problem.
Send a snippet of the code ...
Let's have a look then.
Krgrds,
Perry
"jesper" <jesper_...@yahoo.com> schreef in bericht
news:#kyZ1ucZAHA.1740@tkmsftngp02...
Thanx for taken the time to answer.
Cant send you the template - its 10.000+ codelines (and owned by a client.)
Have solved the problem inserting an errorhandler in the AutoExec Sub
handling error 4248 by adding a document to the Documents collection.
The problem is that the code in a StartUp template fires before Word opens
the first empty document. And therefore no document to read custom document
properties from.
Another work-around is to use a custom Application object with events
(instanciated in Normal.dot) On the Application_Open event a document is
opened as the very first thing.
Regards Jesper
"Perry" <lim...@zonnet.nl> wrote in message
news:Anv%5.1214$iB1.33803@zonnet-reader-1...
Can't you use the .ontime method to start running the other code just a
little later:
http://www.mvps.org/word/FAQs/Userforms/AutoExecUsertFm.htm
Hope this helps,
regards,
Astrid
So that all can benefit from the discussion,
please post all followups to the newsgroup.
Visit the MVP Word FAQ site at http://www.mvps.org/word/
For direct access to all Microsoft newsgroups:
news://msnews.microsoft.com/
"jesper" <jesper_...@yahoo.com> schreef in bericht
news:Om5iIAVgAHA.2028@tkmsftngp04...
If you've worked you way around, good.
Few remarks:
> Cant send you the template - its 10.000+ codelines (and owned by a
client.)
That's why I asked *a* snippet for the relavant part of the code, but I can
imagine the caution you have since it's customer owned.
> Another work-around is to use a custom Application object with events
> (instanciated in Normal.dot) On the Application_Open event a document is
> opened as the very first thing.
I assume that you're testing the AttachedTemplate origin of each new
document that is created, in this case ??
Krgrds,
Perry
"jesper" <jesper_...@yahoo.com> schreef in bericht
news:Om5iIAVgAHA.2028@tkmsftngp04...
U bet. AttachedTemplate-check initializes a lot of things - eg. fixed labels
in bodytext, registry settings a.s.o
The client is the danish ministry of foreign affairs - but I guess you can
see code snippets if you're still interested?
U can probably see the full solution in the danish embassy in NL ;-)
Regards Jesper
"Perry" <lim...@zonnet.nl> wrote in message
news:wjI96.3327$iL1.59292@zonnet-reader-1...
Glad things worked out !
> but I guess you can
> see code snippets if you're still interested?
If you think the code will be a significant contribution to
the group's interest, I'd certainly post it.
Krgrds,
Perry
"jesper" <jesper_...@yahoo.com> schreef in bericht
news:unLY8yFhAHA.320@tkmsftngp05...