Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to avoid Runtime error 4248?

2,482 views
Skip to first unread message

jesper

unread,
Dec 14, 2000, 7:46:00 AM12/14/00
to
Hi group!

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


Perry

unread,
Dec 18, 2000, 4:38:47 PM12/18/00
to
Hi 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...

jesper

unread,
Jan 18, 2001, 8:14:29 AM1/18/01
to
Hi Perry!

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...

Astrid

unread,
Jan 18, 2001, 8:22:40 AM1/18/01
to
Hi Jesper,

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...

Perry

unread,
Jan 18, 2001, 3:33:08 PM1/18/01
to
Hi Jesper,

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...

jesper

unread,
Jan 22, 2001, 5:23:01 AM1/22/01
to
Hi Perry!

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...

Perry

unread,
Jan 22, 2001, 10:54:20 AM1/22/01
to
Yo Jesper!

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...

0 new messages