A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to delete the controls in a CommandBarPopup?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 12th 09, 10:25 AM posted to microsoft.public.outlook.program_addins
Teodora Gancheva[_2_]
external usenet poster
 
Posts: 9
Default How to delete the controls in a CommandBarPopup?

Hi,
I am developing a C# COM add-in for MS Office 2003 and 2007. My add-in
creates a custom command bar with a CommandBarPopup menu containing several
CommandBarPopup submenus populated with CommandBarButton objects. Upon user
click on some buttons, I'd like to perform 'refresh' on the submenus i.e.
delete the buttons and re-create them.
I am doing so using the following code:
for (int index = 1; index = popup.Controls.Count; index++)
{
popup.Controls[index].Delete(1);
index--;
}
This works for all buttons except the one that was actually clicked, for it
a COMException with message "Error HRESULT E_FAIL has been returned from a
call to a COM component" is thrown. Am I not allowed to delete this button
because it has just been clicked, and what other options do I have - delete
the whole popup?
Thanks for all advice,
Teodora Gancheva
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text centered in CommandBarPopup (not left-aligned) Diego Outlook and VBA 3 April 13th 09 06:44 PM
How to Monitor Click event of a CommandBarPopup n777krish Outlook and VBA 1 December 3rd 07 01:54 PM
CommandBarPopup event? Robert G. Schaffrath Add-ins for Outlook 1 October 8th 07 04:21 PM
load CommandBarPopup jim Add-ins for Outlook 0 February 15th 06 06:13 PM
Adding CommandBarPopup into the a specific Inspctor Michael Reukauff Add-ins for Outlook 7 January 26th 06 08:07 AM


All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.