Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Run-Time error '5941'

I have several Word merge documents set up with my database so that when the
user clicks a button, code in the database opens up the Word merge document.
When the Word document opens, code in the Word document runs the merge, makes
a copy of itself and closes the original. Here is a sample of my code in the
Word document:

Option Explicit

Private Sub Document_Open()

Me.MailMerge.OpenDataSource _
Name:="c:\DataSources\KYFDGOLDLGS GOLD_ProjectONESQL.odc", _
Connection:="Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;Initial Catalog=GOLD_ProjectONESQL;data
source=KYFDGOLDLGS;", _
SQLStatement:="SELECT * FROM [TblTEMP_Labels_County]", _
subType:=wdMergeSubTypeOther

Me.MailMerge.Destination = wdSendToNewDocument
Me.MailMerge.Execute
Windows(Me).Close wdDoNotSaveChanges

End Sub

This worked fine until we just got new computers. I understand the new
computers (Dells) came with XP sp3 installed (VB5.7) and MS word has the
latest SP installed as well. The old computers (HP's) should have had XP sp2
which had VB5.6.

Now, when we try to run this, we get "Run-time error '5941': the requested
member of the collection does not exist". Any ideas?


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Run-Time error '5941'

You probably need to make the registry change described in the following
article:

http://support.microsoft.com/kb/825765/


Peter Jamieson

http://tips.pjmsn.me.uk

Todd K. wrote:
I have several Word merge documents set up with my database so that when the
user clicks a button, code in the database opens up the Word merge document.
When the Word document opens, code in the Word document runs the merge, makes
a copy of itself and closes the original. Here is a sample of my code in the
Word document:

Option Explicit

Private Sub Document_Open()

Me.MailMerge.OpenDataSource _
Name:="c:\DataSources\KYFDGOLDLGS GOLD_ProjectONESQL.odc", _
Connection:="Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;Initial Catalog=GOLD_ProjectONESQL;data
source=KYFDGOLDLGS;", _
SQLStatement:="SELECT * FROM [TblTEMP_Labels_County]", _
subType:=wdMergeSubTypeOther

Me.MailMerge.Destination = wdSendToNewDocument
Me.MailMerge.Execute
Windows(Me).Close wdDoNotSaveChanges

End Sub

This worked fine until we just got new computers. I understand the new
computers (Dells) came with XP sp3 installed (VB5.7) and MS word has the
latest SP installed as well. The old computers (HP's) should have had XP sp2
which had VB5.6.

Now, when we try to run this, we get "Run-time error '5941': the requested
member of the collection does not exist". Any ideas?


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Run-Time error '5941'

Thanks Peter. Oddly enough, this problem seems to have worked itself out, as
the merge seems to be running properly (yes, fear me computer, for I am not
afraid to alter your inner code...). I will keep your reply handy should it
arise again.
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Run-Time error '5941'

:-)
(yes, fear me computer, for I am not
afraid to alter your inner code...)


I'm not convinced Word's more obstinate bits understand the meaning of
the word "defeat"...

Peter Jamieson

http://tips.pjmsn.me.uk

Todd K. wrote:
Thanks Peter. Oddly enough, this problem seems to have worked itself out, as
the merge seems to be running properly (yes, fear me computer, for I am not
afraid to alter your inner code...). I will keep your reply handy should it
arise again.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB runtime error 5941 Help maviso5 Microsoft Word Help 3 April 14th 08 09:05 PM
Need help with a euntime 5941 error tweacle Microsoft Word Help 1 February 28th 07 08:50 PM
Error 5941 - The requested member of the collection does not exsis Melisa Microsoft Word Help 3 July 13th 05 03:56 PM
Macro Run-time Error '5941' raymond New Users 4 June 25th 05 12:02 AM
Run-time error '13' Kelli Microsoft Word Help 1 April 30th 05 01:30 AM


All times are GMT +1. The time now is 07:01 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"