A Microsoft Office (Excel, Word) forum. OfficeFrustration

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 » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

adding mailmerge field in word 2000 document



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2004, 02:30 PM
Karel
external usenet poster
 
Posts: n/a
Default 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  
Old May 19th, 2004, 10:05 AM
Cindy M -WordMVP-
external usenet poster
 
Posts: n/a
Default 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

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.