Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VB runtime error 5941 Help | Microsoft Word Help | |||
Need help with a euntime 5941 error | Microsoft Word Help | |||
Error 5941 - The requested member of the collection does not exsis | Microsoft Word Help | |||
Macro Run-time Error '5941' | New Users | |||
Run-time error '13' | Microsoft Word Help |