Run-time error '509' while printing a word document

D

DPM

Hi,

I have got a document which is protected(From MS Word select Tools=>Protect
document, with editing restictions selected)

Now the document is printed to the default windows printrer using
ShellExecute from vb.
The same can be done, by right clicking on the document and select Print
from the popup menu of windows explorer.

The document prints without a problem.

But when MS Word is already opened such as opening another word document or
MS Outlook which uses the word editor and print the document as above the
following error prompts.
"Run-time error '509'
The SetDocumentDirty command is not available because the document is locked
for editing."

I am using MS Word 2003 SP3 (11.8169.8172) on XP.

Please could someone advice, what may be going wrong? or is there any other
settings to be done before printing.
 
T

Terry Farrell

I have no idea. My only guess is that as Word is open to an other document,
it must have something to do with locking files. That suggests that it may
be because normal.dot is locked and the document you are trying to print is
also based on normal.dot. Try attaching the document you are trying to print
to a different template. Then test again. But this is only a wild guess
other than it must have something to do with Locking files created when Word
opens.
 
D

DPM

Thanks Terry.

Terry Farrell said:
I have no idea. My only guess is that as Word is open to an other document,
it must have something to do with locking files. That suggests that it may
be because normal.dot is locked and the document you are trying to print is
also based on normal.dot. Try attaching the document you are trying to
print to a different template. Then test again. But this is only a wild
guess other than it must have something to do with Locking files created
when Word opens.
 

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