K
Karel
Hello,
I have a windows-application written in VB.NET.
Users will be able to make their own word-documents and they will have
the possibility to enter mailmerge fields in it.
To do this I make a commandbar in word and put a combobox (with al the
possible mailmerge fields in it) and a button (to mailmerge) on the
bar.
when you click on a value in the combobox, the value will be a
mailmerge field in the word document. When you click the button he
will mailmerge your document.
in word xp and word 2003 Everything works fine but in word 2000 he
will not put the mailmerge field on the word document when you click
the field in the combobox.
This is the code that's behind the combobox:
(d1 is my word document)
Private Sub ComboBoxEvent_Change(ByVal Ctrl As
Microsoft.office.core.CommandBarComboBox) Handles ComboBoxEvent.Change
Dim a As Word.Selection
a = d1.ActiveWindow.Selection
d1.MailMerge.Fields.Add(a.Range, Ctrl.Text)
a = Nothing
End Sub
d1.activewindow.selection returns an error in word 2000.
the error is : "Run-time exception thrown :
System.Runtime.InteropServices.COMException - Het berichtenfilter
heeft aangegeven dat de toepassing bezet is."
(in english: the messagefilter has indicated that the application is
busy)
If you look to the properties of d1, they all give the same error:
<error: an exception of type:
System.Runtime.InteropServices.COMException} occurred>
in word xp and word 2003 "d1.activewindow.selection" returns
system.__comobject
Can somebody help me please???
I searched myself crazy on this one
thx
Karel
I have a windows-application written in VB.NET.
Users will be able to make their own word-documents and they will have
the possibility to enter mailmerge fields in it.
To do this I make a commandbar in word and put a combobox (with al the
possible mailmerge fields in it) and a button (to mailmerge) on the
bar.
when you click on a value in the combobox, the value will be a
mailmerge field in the word document. When you click the button he
will mailmerge your document.
in word xp and word 2003 Everything works fine but in word 2000 he
will not put the mailmerge field on the word document when you click
the field in the combobox.
This is the code that's behind the combobox:
(d1 is my word document)
Private Sub ComboBoxEvent_Change(ByVal Ctrl As
Microsoft.office.core.CommandBarComboBox) Handles ComboBoxEvent.Change
Dim a As Word.Selection
a = d1.ActiveWindow.Selection
d1.MailMerge.Fields.Add(a.Range, Ctrl.Text)
a = Nothing
End Sub
d1.activewindow.selection returns an error in word 2000.
the error is : "Run-time exception thrown :
System.Runtime.InteropServices.COMException - Het berichtenfilter
heeft aangegeven dat de toepassing bezet is."
(in english: the messagefilter has indicated that the application is
busy)
If you look to the properties of d1, they all give the same error:
<error: an exception of type:
System.Runtime.InteropServices.COMException} occurred>
in word xp and word 2003 "d1.activewindow.selection" returns
system.__comobject
Can somebody help me please???
I searched myself crazy on this one
thx
Karel