Click here to Skip to main content
15,944,136 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I write a word 2003 addin and I have trouble with saving a document which contains CustomDocumentProperties set by me.
Documents are saved in 2 ways:
1st: By intercepting the word's save button --> all OK, the properties included
2st: By clicking on a button of a windows form --> here is the problem

After the button click a new document is created, some CustomDocumentProperties are written like ID and name (max. 20 chars), some text is added to the document and then the document has to be saved but this fails with the following message:
ReportAddIn.WordProcessor: 2011-08-09 17:42:28,418 [4] ERROR saveDocument -
System.Runtime.InteropServices.COMException (0x800A1066): Befehl misslungen

Without writing the custom document properties everything works fine.
For word 2010 and 2007 the code runs fine.

What does the problem is?
Please help...

1 solution

The Office Primary Interop Assemblies (PIA) are not compatable between office 2003 and prior to Office 2007 and later. That does not mean you can't address your issues.

Do a search on google or at MSDN for "Word 2003 2007 PIA" or "Word 2003 2007 interop" and start learning how to work with them.

Share this answer
S Houghtelin 10-Aug-11 6:25am    
It's called progress, I know some peoples idea of progress may not be the same as others but the fact is newer, better features were added to the Office 2007 and up suite that simply were not a part of the previous versions.

As of April 15, 2009, mainstream support was no longer available for Office 2003, they want people to buy the newer versions.

Now for your concern, perhaps you can provide the code with which you are have trouble with. There usually is a work around. Without specifics no one can help you. Something like, "When I get to this line:

MyVar = ThisDocs.parameter.Title

Then describe what you were trying to do, like I am trying to grab the Title from My document.

If you are not sure which line is causing the issue comment them out one at a time until the program works, then start putting them back in until the program breaks again. This is debugging.

I am trying to be helpful here, please don't be insulted if I appear being too simplistic I have no idea where your programming abilities are.
Hoppel12 10-Aug-11 6:17am    
OK sorry, a bug in my code. My mistake!
The save callback method cancels the save request in word 2003 and the document is never saved.

Sorry and thanks for your advise.
S Houghtelin 10-Aug-11 6:27am    
OK, sounds good. I am glad you were able to work your issue out.

Good luck and happy codinng :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900