B
Bruce Baker
Hi
My VB.net app needs to cater for some of my clients who are still using
Office 2000 (some are using Office 2007 though)
We do some basic mail-merge stuff. Open a document, set a few bookmarks,
print it and then move onto the next client.
In VB6, I used to add a reference to msword.olb.
What do I need to do to get it to work - I've tried to add that as a
reference, and then Visual Studio does something magic with the 'interop'
stuff - and more importantly I get an exception when trying to load my
document
oApp.Documents.Open("c:\myDoc.doc", , True)
gives me an exception of
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object&
ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object&
PasswordDocument, Object& PasswordTemplate, Object& Revert, Object&
WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object&
Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection,
Object& NoEncodingDialog, Object& XMLTransform)
Please help !
thanks
Bruce
My VB.net app needs to cater for some of my clients who are still using
Office 2000 (some are using Office 2007 though)
We do some basic mail-merge stuff. Open a document, set a few bookmarks,
print it and then move onto the next client.
In VB6, I used to add a reference to msword.olb.
What do I need to do to get it to work - I've tried to add that as a
reference, and then Visual Studio does something magic with the 'interop'
stuff - and more importantly I get an exception when trying to load my
document
oApp.Documents.Open("c:\myDoc.doc", , True)
gives me an exception of
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object&
ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object&
PasswordDocument, Object& PasswordTemplate, Object& Revert, Object&
WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object&
Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection,
Object& NoEncodingDialog, Object& XMLTransform)
Please help !
thanks
Bruce