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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
adding mailmerge field in word 2000 document
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 |
#2
|
|||
|
|||
adding mailmerge field in word 2000 document
Hi Karel,
You may have better luck getting help on this in a VB language dotnet group, as it appears to be a problem in the interface between .NET and Word 2000. Based on my rather limited knowledge of these things, the only question I know how to ask is: Are you certain you're using the correct PIAs for Office 2000? I do know that you have to let VB.NET generate the PIAs for Office 2000, and that these will differ from those of later versions. But whether you need to perform other contorsions in order to successfully communicate with the Word 2000 object model I don't know. 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 Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Thread Tools | |
Display Modes | |
|
|