Combobox .change event stops work after a while??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Karsten_Markmann

    #1

    Combobox .change event stops work after a while??

    Hi
    I am building a large application where we use the combobox feature a
    lot.
    Its an office addin for office XP.
    I am using Visual studio 2003 VB.

    In outlook and excel it works perfect all the time, but in Word it
    stops work after a randomly amount of time?
    (The Event ".Change" does apparently not fire).
    Does anyone have some ideas what can cause this problem?

    Below are some code snippets from my application.
    Any help appriciated.

    Kind Regards:
    Karsten Markmann

    <GuidAttribute( "9132AA66-FDA6-4023-BCEB-75BA61D2997C"),
    ProgIdAttribute ("KiCSystem.Con nect")_
    Public Class Connect

    Implements Extensibility.I DTExtensibility 2
    Private WithEvents cmbSearchCoveo As CommandBarCombo Box
    ----

    cbrNewToolbar = KiCData.hostApp .CommandBars.Ad d(Name:="KiC LRØ
    system 2", Position:=msoBa rTop, Temporary:=True )
    ----

    cmbSearchCoveo =
    cbrNewToolbar.C ontrols.Add(Typ e:=MsoControlTy pe.msoControlCo mboBox)
    With cmbSearchCoveo
    .BeginGroup = True
    .Visible = True
    .Style = MsoComboStyle.m soComboLabel
    .Caption = "Fritekst søgning:"
    .TooltipText = "Fritekst søgefelt i KiC systemet.
    Søger i alle dokumenter efter det skrevne."
    .Tag = "SearchCove o"
    End With

    ----

    Private Sub cmbSearchCoveo_ Change(ByVal Ctrl As
    Microsoft.Offic e.Core.CommandB arComboBox) Handles
    cmbSearchCoveo. Change

    ShowIEURL(HTTPS EARCH & cmbSearchCoveo. Text)

    End Sub
    ---

  • Cindy M.

    #2
    Re: Combobox .change event stops work after a while??

    Hi Karsten_Markman n,
    I am building a large application where we use the combobox feature a
    lot.
    Its an office addin for office XP.
    I am using Visual studio 2003 VB.
    >
    In outlook and excel it works perfect all the time, but in Word it
    stops work after a randomly amount of time?
    (The Event ".Change" does apparently not fire).
    Does anyone have some ideas what can cause this problem?
    >
    Difficult to tell, but it looks like you didn't declare the object
    variable for the toolbars and buttons at the class level? If you do
    not, they'll eventually be garbage collected.

    The other thing to watch out for is that you should assign a unique
    string value to the controls' TAG property. Word uses this (with its
    MDI UI) to keep track of what window you're currently in.

    Cindy Meister
    INTER-Solutions, Switzerland
    http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


    This reply is posted in the Newsgroup; please post any follow question
    or reply in the newsgroup and not by e-mail :-)

    Comment

    • Karsten_Markmann

      #3
      Re: Combobox .change event stops work after a while??

      I have tried this now, but still having trouble?
      The following is the start of my conect class:
      Isn't this what you mean?
      I alse have different tags for the buttons.


      Option Explicit On

      Imports Microsoft.Offic e.Core

      Imports Extensibility
      Imports System.Runtime. InteropServices
      Imports System.Drawing
      Imports System.Windows. Forms
      Imports System.IO

      <GuidAttribute( "9132AA66-FDA6-4023-BCEB-75BA61D2997C"),
      ProgIdAttribute ("KiCSystem.Con nect")_
      Public Class Connect

      Implements Extensibility.I DTExtensibility 2
      Private WithEvents cmbSearchCoveo As CommandBarCombo Box
      Public WithEvents cmdFindKiC As
      Microsoft.Offic e.Core.CommandB arButton
      Private WithEvents cmbFindKiC As
      Microsoft.Offic e.Core.CommandB arButton
      Private WithEvents cmbSaveEmailKiC As
      Microsoft.Offic e.Core.CommandB arButton
      Private WithEvents cmbSkabelonerKi C As
      Microsoft.Offic e.Core.CommandB arButton
      Private WithEvents cmbSearchCoveoB utton As
      Microsoft.Offic e.Core.CommandB arButton
      Private cbrNewToolbarPr ivate As CommandBar

      -----

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Combobox .change event stops work after a while??

        Karsten,

        I an not (yet) known with using Microsoft.offic e in VB.Net.

        However be aware that an event in a combobox in VB.Net will often result
        that he calls himself again (recursive) a good reason that your program
        stops because the combobox has eaten all your memory.

        Cor

        "Karsten_Markma nn" <kma@lro.dkschr eef in bericht
        news:1177931247 .856817.217900@ o5g2000hsb.goog legroups.com...
        >I have tried this now, but still having trouble?
        The following is the start of my conect class:
        Isn't this what you mean?
        I alse have different tags for the buttons.
        >
        >
        Option Explicit On
        >
        Imports Microsoft.Offic e.Core
        >
        Imports Extensibility
        Imports System.Runtime. InteropServices
        Imports System.Drawing
        Imports System.Windows. Forms
        Imports System.IO
        >
        <GuidAttribute( "9132AA66-FDA6-4023-BCEB-75BA61D2997C"),
        ProgIdAttribute ("KiCSystem.Con nect")_
        Public Class Connect
        >
        Implements Extensibility.I DTExtensibility 2
        Private WithEvents cmbSearchCoveo As CommandBarCombo Box
        Public WithEvents cmdFindKiC As
        Microsoft.Offic e.Core.CommandB arButton
        Private WithEvents cmbFindKiC As
        Microsoft.Offic e.Core.CommandB arButton
        Private WithEvents cmbSaveEmailKiC As
        Microsoft.Offic e.Core.CommandB arButton
        Private WithEvents cmbSkabelonerKi C As
        Microsoft.Offic e.Core.CommandB arButton
        Private WithEvents cmbSearchCoveoB utton As
        Microsoft.Offic e.Core.CommandB arButton
        Private cbrNewToolbarPr ivate As CommandBar
        >
        -----
        >

        Comment

        Working...