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

New form freezes on CommandBarButton.Click



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 3rd 06, 08:55 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 1
Default New form freezes on CommandBarButton.Click

Hi

I'm creating a CommandBarButton for Outlook that creates a new form in
the Click event handler.

The problem is that when I show the form it seems to be frozen and
accepts no user input.

I ripped most of the code from an example found on MSDN:
http://msdn.microsoft.com/library/de...addinvbnet.asp

But somehow there is a difference that I can't spot. Have any of you
experienced anything like this?

My code is very straight forward:

------

Dim WithEvents _inspectors As Outlook.Inspectors
Dim WithEvents _commandButton As CommandBarButton

Private Sub OnConnection(...)
_inspectors = application.Inspectors
End Sub

Private Sub OnNewInspector(...) Handles _inspectors.NewInspector
If TypeOf inspector.CurrentItem Is Outlook.MailItem Then
Dim _commandBar As CommandBar =
inspector.CommandBars("Standard")
_commandButton =
CType(_commandBar.Controls.Add(MsoControlType.msoC ontrolButton),
CommandBarButton)
_commandButton.Caption = "Test"
_commandButton.Style = MsoButtonStyle.msoButtonCaption
_commandButton.Visible = True
End If
End Sub

Public Sub OnButtonClick(...) Handles _commandButton.Click
Dim frmTest As New TestForm()
frmTest.Show()
System.Windows.Forms.Application.DoEvents()
End Sub

 




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
HELP ME! Outlook Express Freezes When I Click On A Link stacieglass Outlook Express 2 May 18th 06 08:06 PM
HELP ME! Outlook Express Freezes When I Click On A Link stacieglass Outlook - General Queries 1 May 17th 06 10:05 PM
OE Freezes if click Hyperlink in email 'PuterSpaz Outlook Express 1 April 17th 06 12:02 PM
OE freezes when I click on a hyperlink KBAR Outlook Express 3 February 11th 06 09:37 PM
Outlook Addin CommandBarButton Click Event Not Firing Stu Add-ins for Outlook 0 January 17th 06 02:10 AM


All times are GMT +1. The time now is 09:25 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.