S
Sandesh Patnam
« Previous Thread
Today, 6:16 AM UTC
Sandesh Patnam
Posts 2
CommandBarButton not getting deleted in MS Word
I am developing an Add-In for Word/Excel/PowerPoint applications. I am
using Office 2003. In the OnBeginShutDown method, I am trying to delete the
existing button. The button gets deleted for Excel and PowerPoint. But for
Word, it is throwing "Exception from HRESULT: 0x800A01A8" exception.
Please suggest me a fix for this or atleast an alternative to prevent this
exception.
Report Abuse
Today, 6:33 AM UTC
Pavan Kulkarni
Posts 77 Re: CommandBarButton not getting deleted in MS Word
Was this post helpful ?
Hi Sandesh,
This is quite a common issue with Word and you can find solution to this in
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356963&SiteID=1&mode=1&PageID=0 thread.
Report Abuse
Today, 7:45 AM UTC
Sandesh Patnam
Posts 2
Re: CommandBarButton not getting deleted in MS Word
Hi Pavan,
Thanks for your suggestion. I implemented the solution mentioned in the
thread. But still I am getting the same exception while trying to delete the
button. In addition to that I am getting a confirmation message saying that
"Do you want to save changes made to temp.dot" which is irritative to the end
user.
Report Abuse
Today, 7:58 AM UTC
Cindy Meister
MVP
Posts 496 Re: CommandBarButton not getting deleted in MS Word
Was this post helpful ?
Hi Sandesh
Let's start with the easy part, first: the confirmation message You need
to either save the changes to the template, or tell Word not to worry about
saving changes. If you want to save your changes to the template, then use
the SAVE method in your code after you've made the changes.
If you want to throw away the changes, use the SAVED property to indicate to
Word that there's nothing left to be saved.
Beyond that
1. This isn't the correct venue to discuss COM-Addins, really. The
discussion group for that topic is
http://msdn.microsoft.com/newsgroup...ic.office.developer.com.add_ins&lang=en&cr=US
2. We need to see your code for adding the button. My best guess would be
that you aren't specifying the CustomizationContext - telling Word where you
want to create/delete the button.
3. Using the technique described in the message pavan pointed you to, you
wouldn't necessarily NEED to use code to create/delete the button in a
separate template. If this is a button that should always be present when
your Add-in (the template) is loaded, then you can create it in the template
in Word's UI and just leave it there.
Today, 6:16 AM UTC
Sandesh Patnam
Posts 2
CommandBarButton not getting deleted in MS Word
I am developing an Add-In for Word/Excel/PowerPoint applications. I am
using Office 2003. In the OnBeginShutDown method, I am trying to delete the
existing button. The button gets deleted for Excel and PowerPoint. But for
Word, it is throwing "Exception from HRESULT: 0x800A01A8" exception.
Please suggest me a fix for this or atleast an alternative to prevent this
exception.
Report Abuse
Today, 6:33 AM UTC
Pavan Kulkarni
Posts 77 Re: CommandBarButton not getting deleted in MS Word
Was this post helpful ?
Hi Sandesh,
This is quite a common issue with Word and you can find solution to this in
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356963&SiteID=1&mode=1&PageID=0 thread.
Report Abuse
Today, 7:45 AM UTC
Sandesh Patnam
Posts 2
Re: CommandBarButton not getting deleted in MS Word
Hi Pavan,
Thanks for your suggestion. I implemented the solution mentioned in the
thread. But still I am getting the same exception while trying to delete the
button. In addition to that I am getting a confirmation message saying that
"Do you want to save changes made to temp.dot" which is irritative to the end
user.
Report Abuse
Today, 7:58 AM UTC
Cindy Meister
MVP
Posts 496 Re: CommandBarButton not getting deleted in MS Word
Was this post helpful ?
Hi Sandesh
Let's start with the easy part, first: the confirmation message You need
to either save the changes to the template, or tell Word not to worry about
saving changes. If you want to save your changes to the template, then use
the SAVE method in your code after you've made the changes.
If you want to throw away the changes, use the SAVED property to indicate to
Word that there's nothing left to be saved.
Beyond that
1. This isn't the correct venue to discuss COM-Addins, really. The
discussion group for that topic is
http://msdn.microsoft.com/newsgroup...ic.office.developer.com.add_ins&lang=en&cr=US
2. We need to see your code for adding the button. My best guess would be
that you aren't specifying the CustomizationContext - telling Word where you
want to create/delete the button.
3. Using the technique described in the message pavan pointed you to, you
wouldn't necessarily NEED to use code to create/delete the button in a
separate template. If this is a button that should always be present when
your Add-in (the template) is loaded, then you can create it in the template
in Word's UI and just leave it there.