CommandBarButton not getting deleted in MS Word



« 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/newsgroups/default.aspx?dg=microsoft.public.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.




--------------------------------------------------------------------------------
-- Cindy Meister (Word MVP)






.



Relevant Pages

  • Re: printing custom size envelopes
    ... Word does'nt work real well with odd-size envelopes, ... Graham Mayor's site (which you can find through one of his posts here or on ... This isn't elegant and I may have to change the template if I change ... See also the MVP FAQ: http://www.mvps.org/word which is awesome! ...
    (microsoft.public.word.docmanagement)
  • Forms, Bookmarks, and Ref Fields
    ... posts and the published info on this topic but to no avail. ... practice document template. ...
    (microsoft.public.word.docmanagement)
  • Re: Cant change fonts/sizes
    ... Are my posts in this thread invisible? ... Word MVP FAQ site: http://word.mvps.org ... >:> that you need to remove to stop Word from seeing the template. ... Could it be a display driver that is only used in Word that got ...
    (microsoft.public.word.newusers)
  • Re: Blogger.com Question
    ... > I have slightly customised the sidebar on blogger.com with some extra ... > the side bar my profile and previous posts only. ... > use the same sidebar template as my normal blog page? ...
    (uk.games.video.misc)
  • APWW Traffic 17th - 30th December 2007
    ... WWE Armageddon started on 17th December at 00:00:00 UTC ... Day Posts Percentage ... 901 posts made by 140 posters ... Rank / Posts / Previous Rank / Poster ...
    (rec.sport.pro-wrestling)