Hi,
I'm using word in my C# windows application. I added an event handler to
handle DocumentBeforeClose event. Inside the event handler, I set the
second parameter Cancel to true. According to documentation, if Cancel is
true, the document will not be closed. But the document closes anyway with
my interop application.
I know this worked when I used the COM server directly. Help? Thanks
dax
Jian-Shen Lin[MS] - 29 Oct 2003 03:25 GMT
Hi Dax,
The problem is you are using VS.NET 2003, which is based on 1.1 Framework.
There is a known bug with the Cancel parameter in Office application events
when run from 1.1 framework. Roll back to 1.0 Framework (VS.NET 2002), or
override the delegate class for the event handler in your 1.1 code in order
to implement your own connection point class handler. The problem is an
issue with the Word/Excel type libraries and how the Cancel parameter is
marshalled. This is a known bug with Office 2000 and Office XP, which was
fixed in Office 2003.
Thanks
Jian Shen
This posting is provided "AS IS" with no warranties, and confers no rights.