J
john Lee
Dear.
The following code is that add new combobox commandbar in Word.
The change event is occured once the word program launched the first time.
After this, the user open another word document, the change event is not
occured.
However other button control(CommandBarButton) click event is occured in all
of documents.
I don;t know the reason why the combobox change event is not occurred in
the other document window than the first document.
Best Regards.
m_cmbLang = commandBar.FindControl(Tag:=BTN_LANGPAIR_TAG)
If m_cmbLang Is Nothing Then
m_cmbLang =
CType(commandBar.Controls.Add(Type:=Microsoft.Office.Core.MsoControlType.msoControlComboBox,
Parameter:=BTN_LANGPAIR_TAG, Temporary:=True),
Global.Microsoft.Office.Core.CommandBarComboBox)
With m_cmbLang
.Style =
Global.Microsoft.Office.Core.MsoComboStyle.msoComboNormal
.AddItem(IDS_ENGTOCHN, 1)
.AddItem(IDS_CHNTOENG, 2)
.Width = 60
.DropDownLines = 2
.BeginGroup = True
.ListHeaderCount = 0
.Tag = BTN_LANGPAIR_TAG
.ListIndex = OriginalLang
End With
AddHandler m_cmbLang.Change, AddressOf btnLangChange
End If
The following code is that add new combobox commandbar in Word.
The change event is occured once the word program launched the first time.
After this, the user open another word document, the change event is not
occured.
However other button control(CommandBarButton) click event is occured in all
of documents.
I don;t know the reason why the combobox change event is not occurred in
the other document window than the first document.
Best Regards.
m_cmbLang = commandBar.FindControl(Tag:=BTN_LANGPAIR_TAG)
If m_cmbLang Is Nothing Then
m_cmbLang =
CType(commandBar.Controls.Add(Type:=Microsoft.Office.Core.MsoControlType.msoControlComboBox,
Parameter:=BTN_LANGPAIR_TAG, Temporary:=True),
Global.Microsoft.Office.Core.CommandBarComboBox)
With m_cmbLang
.Style =
Global.Microsoft.Office.Core.MsoComboStyle.msoComboNormal
.AddItem(IDS_ENGTOCHN, 1)
.AddItem(IDS_CHNTOENG, 2)
.Width = 60
.DropDownLines = 2
.BeginGroup = True
.ListHeaderCount = 0
.Tag = BTN_LANGPAIR_TAG
.ListIndex = OriginalLang
End With
AddHandler m_cmbLang.Change, AddressOf btnLangChange
End If