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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge with word Bookmark - text truncated 255 chars

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I have a mailmerge document which has bookmarks I dynamically add text to....
Code:
    Set BMRange = owordApp.ActiveDocument.Bookmarks("Sales").Range
    BMRange.Text = Me.Sales_Info
    owordApp.ActiveDocument.Bookmarks.Add "Sales", BMRange

All text added to these bookmarks is being truncated at 255 characters.

How do I resolve this?

Thanks.
1DMF


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
Hi 1DMF,

Have you confirmed that Me.Sales_Info returns more than 255 characters?

Cheers
Paul Edstein
[MS MVP - Word]
 
With just this snippet it is hard to say. My first guess is that the text is already truncated, not that the assignment to the range truncates it.

you could test this

Set BMRange = owordApp.ActiveDocument.Bookmarks("Sales").Range
debug.print "Incoming Info range length: " & len(Me.Sales_Info)
BMRange.Text = Me.Sales_Info
debug.print "Outgoing Range length: " & len(bmRange.text) & vbcrlf
owordApp.ActiveDocument.Bookmarks.Add "Sales", BMRange


Now you would know if the the truncation is before or after the assignment. If before then what is Sales_Info?
 
Well the truncation seems to be after assignment to the bookmark, but doesn't match the mailmerged result...
Incoming Info range length: 1002
Outgoing Range length: 998

It's only showing a few chars difference, yet the text in the merged doc is truncated @ 255 chars?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
Hi 1DMF,

You're not making sense - to me at least. Is the problem with the mailmerge output, or what you're trying to add to what I suppose is the mailmerge main document via your userform? If it's the former, try changing the mailmerge connection method to DDE. If it's the latter, you need to tell us what Me.Sales_Info returns (eg what do you see if you use "MsgBox Me.Sales_Info")

Cheers
Paul Edstein
[MS MVP - Word]
 
sorry If I'm not expressing myself very well.

I have a word document with bookmarks in it. I have a form with memo fields on it bound to nText fields in the SQL backend.

The user types text into the memo fields that they want to appear in the merged document.

Using the above test code the memo field has 1002 chars in it, BMRange variable when passed the memo field data then has 998 chars in it. (not sure where 4 chars have gone already?)

However, the final merged word document only has 255 chars displaying in the bookmarks?

Where are all the characters going during the mailmerge?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top