Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert a long string into Word
Message
From
02/06/2008 03:10:42
 
 
To
28/05/2008 22:30:58
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01000436
Message ID:
01320890
Views:
11
Good Lord. I'd forgotten I ever knew this <g>
Glad it helped,
Viv

>Viv, I just wanted to say thanks! Your sample code really helped me out, as I too ran into the over 254 char replacement issue.
>-Mark
>
>>Hi,
>>I think the maximum string length using this method is 254. Something like the following should work:
>>
>>IF LEN(lcString) < 254
>>  WITH THIS.oWordDoc.Content.FIND
>>    .TEXT = lcSearchString
>>    .FORMAT = .F.
>>    .MatchCase = .T.
>>    .Replacement.TEXT = lcString
>>    .Execute(,,,,,,,,,,2)		&& 2 = Replace all
>>  ENDWITH
>>ELSE
>>  * Can't use simple find/replace because replacement string is too long....
>>  DO WHILE .T.
>>    loRange = THIS.oWordDoc.RANGE(0,0)
>>    WITH loRange.FIND
>>      .TEXT = lcSearchString
>>      .FORMAT = .F.
>>      .MatchCase = .T.
>>      llFound = .Execute()
>>      IF llFound
>>        loRange.TEXT = lcString
>>      ELSE
>>        EXIT
>>      ENDIF
>>    ENDWITH
>>  ENDDO
>>ENDIF
>>
>>HTH,
>>Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform