Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert a long string into Word
Message
De
01/04/2005 04:00:56
 
 
À
31/03/2005 14:41:31
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01000436
Message ID:
01000550
Vues:
20
Hi,
>>
Problem:
I need to insert some descriptions from a string from VFP into some Word DOC's and some of those comments can be 15 lines long, how can this be done ?
Any sample somewhere ?
Also, wich is the maximum width of a string that can be passend to Word ?
>>
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform