Reading a Word Doc saved as a OLEObject Filed in a Database

M

Magnus.Moraberg

Hi,

I'm working in C# and am reading from a MsAccess database which has a
OLEObject Field where I save Word documents. I wish to open the word
document and read it, for example -

wordDocument.Unprotect(ref nullObject);

// loop through all the fields in the document
for (int i = 1; i <= wordDocument.FormFields.Count; i++)
{...
}

etc, etc.

To do this, should I read the OLEField into a byte array and then save
this byte array into a tmp document? Then open the temp document as
follows -

Word.Document wordDocument = wordApplication.Documents.Open(
ref fileNameRef,
ref nullObject, ref nullObject, ref
nullObject, ref nullObject, ref nullObject,
ref nullObject, ref nullObject, ref
nullObject, ref nullObject, ref nullObject,
ref nullObject, ref nullObject, ref
nullObject, ref nullObject);

Or maybe there is an easier way?

Thanks,

Barry
 

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