Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacement string sending to word too long...
Message
 
 
To
03/05/2002 04:41:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00651508
Message ID:
00652614
Views:
19
>>I have a word template that has several fields replaced before being sent out. This is done using the search and replace functions:
>>
>>WITH oRange.Find
>> .Replacement.Text = ALLTRIM(outfile.spec_inst)
>> lFound = .Execute(,,,,,,,1,,,wdReplaceOne)
>>ENDWITH
>>
>>This works fine for all my replacement fields. But this specific one is a memo field, and I guess someone finally filled it in past the string limit. I am getting: OLE lDispatch exception code from Microsoft Word: String parameter too long.
>>
>>What I am looking for is a work around or fix. So far I have found nothing besides going to a mail merge (which at this point I'm not sure I want to do). Any thoughts would be appreciated.
>>
>>Thanks,
>>Kevin
>
>Kevin,
>You might try a few things :
>-Try passing your string divided into smaller parts (255 chars but chose 250):
>
>.Replacement.Text = lc250CharsPortion1+lc250CharsPortion2..lc250CharsPortionN
>
>-Use copy&paste
>_cliptext = ALLTRIM(outfile.spec_inst)
>.ReplacementText = ""
>.Execute(...)
>oRange.Paste
>
>etc.
>
>PS: I didn't understand why you use find-replace for docvariables. You could directly set them. ie:
>.Variables(cVarName).value = cValue
>Cetin

Cetin,

The copy and paste works great. Thanks for leading me in that direction. The reason I used the find-replace was because this was my first attempt at automating word. I wasn't (and still am not) aware of all my options and the find-replace worked for 6 months until someone went past the string limit on the one memo field.

Thanks again,
Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform