Query truncates Memo field when exported to word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have read the post "Memo field only returns 255 characters" from 2.8.2005
but that did not help my problem. My query returns all characters, but when:

docWord.Bookmarks("bkm" & i).Range.Text = rds.Fields(i).Value

runs, the field is "changed" to the first 255 characters then, and I quote:
à­î‚¼ ä¯çŸ¯ä‚…矯 ׈粑 ׈粑顈୥ Ց粑ݸ խ粑顰୥é¡à­¥é‘୥ Ց粑ܘ խ粑 ×ˆç²‘é˜€à­¥î‡ Õ‘ç²‘Ý¸ խ粑阨୥阈୥霈୥Ց粑࠸ խ粑 î…€
׈粑궘ࡼ Ց粑ݸ խ粑귀ࡼ궠ࡼêࡼՑ粑࠸ խ粑ꀌࡼ雠୥ ꀌ

(this goes on and on and ends with "I AM THE GATES. I WILL SMITE THEE DOWN
WITH LIMITATIONS FROM MS-DOS! HEAR ME ROAR!" well ok not the last part...)

How do i work around the probelm while still using the book mark in word?

SQL Server 2000 SP4 Back-end
Win XP MDB front end (I am working on porting to ADP)
Access 2003
 
I tried ADO when creating the recordset that will populate the word doc. It
is a bit more tedius to program; however, ADO returned ALL characters in
proper order when adding text to a word doc:

Set con = CurrentProject.AccessConnection

Set rds = New ADODB.Recordset
With rds
Set .ActiveConnection = con
.Source = "view1" ' OR .Source = viewSQL (where viewSQL is a function
that retuns a string)
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
End With

' set reference to MS Word. If an application is already running then use
the current instance
On Error Resume Next
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then Set appWord = CreateObject("Word.Application"):
Err.Clear

appWord.Activate: appWord.Visible = True

' Open a new document from the template
Set docWord = appWord.Documents.Add(completePath(strAppInfo("wordLoadPath"))
& strTemplate)

For i = 0 To docWord.Bookmarks.Count
docWord.Bookmarks("bkm" & i).Range.Text = rds.Fields(i).Value
Next i
 
Hi =?Utf-8?B?cm9nZ2U=?=,
I have read the post "Memo field only returns 255 characters" from 2.8.2005
but that did not help my problem. My query returns all characters, but when:

docWord.Bookmarks("bkm" & i).Range.Text = rds.Fields(i).Value

runs, the field is "changed" to the first 255 characters then, and I quote:
à­î‚¼ ä¯çŸ¯ä‚…矯 ׈粑 ׈粑顈୥ Ց粑ݸ
խ粑顰୥é¡à­¥é‘୥ Ց粑ܘ խ粑 ×ˆç²‘é˜€à­¥î‡ Õ‘ç²‘Ý¸
խ粑阨୥阈୥霈୥Ց粑࠸ խ粑 
׈粑궘ࡼ Ց粑ݸ խ粑귀ࡼ궠ࡼêࡼՑ粑࠸ խ粑ꀌࡼ雠୥ ꀌ

(this goes on and on and ends with "I AM THE GATES. I WILL SMITE THEE DOWN
WITH LIMITATIONS FROM MS-DOS! HEAR ME ROAR!" well ok not the last part...)
"The field is 'changed' to..." Which field?

If you pick up the rds.Field(i).Value into a string variable, does it contain all
the characters?

If not, then you know the problem is in how you've connected to your data, not in
the Word bookmark. And then you need to tell us more how you're making that
connection...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :-)
 
Back
Top