A
Adrian
Hi,
I am using c# to auotmate Word 2000. The task involves
opening a Document and creating a print file from that
document. However, if another user already has the
document open, a dialog from Word stating "xyz.doc is
locked for editing" etc. is produced. I am forced to
manually click on the Read Only button displayed in the
dialog while the c# program execution is halted. I need
this process to operate unattended & cannot be clicking
this dialog whenever it appears.
The relevant code snippet to open the doc is:
ObjWord.Documents.Open(ref filename, ref
confirmConversions, ref readOnly, ref addToRecentFiles,
ref passwordDocument, ref passwordTemplate, ref revert,
ref writePasswordDocument, ref writePasswordTemplate, ref
format, ref encoding, ref visible);
The "ref readOnly" parameter has been assigned using:
Object readOnly = true;
but does not appear to force the document to be opened in
read-only mode.
Thankyou for any help.
Adrian.
I am using c# to auotmate Word 2000. The task involves
opening a Document and creating a print file from that
document. However, if another user already has the
document open, a dialog from Word stating "xyz.doc is
locked for editing" etc. is produced. I am forced to
manually click on the Read Only button displayed in the
dialog while the c# program execution is halted. I need
this process to operate unattended & cannot be clicking
this dialog whenever it appears.
The relevant code snippet to open the doc is:
ObjWord.Documents.Open(ref filename, ref
confirmConversions, ref readOnly, ref addToRecentFiles,
ref passwordDocument, ref passwordTemplate, ref revert,
ref writePasswordDocument, ref writePasswordTemplate, ref
format, ref encoding, ref visible);
The "ref readOnly" parameter has been assigned using:
Object readOnly = true;
but does not appear to force the document to be opened in
read-only mode.
Thankyou for any help.
Adrian.