Hello, I'm automating Word 2007 from an Outlook 2007 Addin done with VAS2008. But I can't write any document property: ((Microsoft.Office.Core.DocumentProperties)(oWord.ActiveDocument.BuiltInDocumentProperties))[Word.WdBuiltInProperty.wdPropertyCategory].Value =categories; I get a very strange error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). Any idea? Thanks.
Found the solution. See http://support.microsoft.com/kb/303296/en-us Why the MSDN library still hasn't been updated anywhere is beyond me. "Cedric" wrote: > Hello, > > I'm automating Word 2007 from an Outlook 2007 Addin done with VAS2008. > > But I can't write any document property: > ((Microsoft.Office.Core.DocumentProperties)(oWord.ActiveDocument.BuiltInDocumentProperties))[Word.WdBuiltInProperty.wdPropertyCategory].Value =categories; > > I get a very strange error: > > Unable to cast COM object of type 'System.__ComObject' to interface type > 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the > QueryInterface call on the COM component for the interface with IID > '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}' failed due to the following error: > No such interface supported (Exception from HRESULT: 0x80004002 > (E_NOINTERFACE)). > > Any idea? > > Thanks.