Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-Time '9105' String is longer than 255 characters.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
I have a question about an error I received using VBA in MS Word XP . The error message I receive is;

Run-Time
'9105'
String is longer than 255 characters

Here is my code;

' pccmember3 Macro
' Macro recorded 6/22/2005 by meg17-05
'
ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\bsn-test\Test of AccessCustomerDatabaseXA.mdb", ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=F:\bsn-test\Test of AccessCustomerDatabaseXA.mdb; _
"Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Typ" _
, SQLStatement:="SELECT * FROM `registrationPCCMEMBERS`", SQLStatement1:= _
"", SubType:=wdMergeSubTypeAccess
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
-------------------------------------------
Of course the underscores are new lines which was automatically put in
------------------------------------------------
Here is where VBA highlights the error;

ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\bsn-test\Test of AccessCustomerDatabaseXA.mdb", ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=F:\bsn-test\Test of AccessCustomerDatabaseXA.mdb;Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Typ" _
, SQLStatement:="SELECT * FROM `registrationPCCMEMBERS`", SQLStatement1:= _
"", SubType:=wdMergeSubTypeAccess

I belive it's a simple syntax error somewhere. Does anyone notice where the problem is?

Hopefully, the information above is clear.

Thanks,
KJ
 

This is the MS Office Forum.

Please post in the VBA Forum707

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [bomb][tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top