ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Correcteur word ou autre   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

lun. 02 février 2015, 18h13
eddymaue
atoutfox.public.association

Re: Correcteur word ou autre

* Auteur Eddy Maue ;o)
#define GoTo1 locate
Create Cursor csr1 ( txt1 c(20), page i)

Insert into csr1 values("Je",2)
Insert into csr1 values("suis",2)
Insert into csr1 values("un",2)
Insert into csr1 values("extra", 2)
Insert into csr1 values("-", 2)
Insert into csr1 values("terrestre",2)
Insert into csr1 values("Jean",2)
Insert into csr1 values("DENIS",2)

Create Cursor Dicto ( mot c(20) )
Insert into Dicto values("je")
Insert into Dicto values("suis")
Insert into Dicto values("un")
Insert into Dicto values("extra")
Insert into Dicto values("terrestre")
Insert into Dicto values("-")

Index On Lower(mot) tag mot

Select csr1
Goto1

set EXACT on && pour éviter Je jean

Do while Seek(Lower(txt1),"Dicto","mot")

Wait WINDOW txt1 +" est dans le dicto"
skip

enddo



Guy BONEMME a couché sur son écran :
> Merci Eddy,
> mais ce n'est pas ce que je cherche
>
> L'extraction du document word est ok
> j'ai une table essai comprenant
> avec 2 champs :
> mot, npage
> * exemple
> Je 2
> suis 2
> un 2
> extra 2
> - 2
> terrestre 2
> Jean 2
> DENIS 2
>
> Je veux éliminer les 6 premiers dans une boucle
> DO...du 1er au dernier
> lmot = ESSAI(le mot cherché)
> IF exist(lmot) ** dans le dictionnaire
> DELETE
> ENDIF
> ENDDO
> PACK
>
> Est-ce plus clair?
>
> eddymaue a pensé très fort :
>
>> Je ne suis pas sur d'avoir bien saisi
>>
>> bref un p'tit bout d'exemple pour faire Recheche/Remplacement
>>
>> en bleu ce que tu as à modifier
>>
>> Bonne chance
>>
>> ***********SEARCH AND REPLACE***************
>> set step on
>>
>> Public g_oWord
>> g_oWord = CREATEOBJECT("word.application")
>> g_oWord.documents.Open("TonDocument.docx")
>>
>> g_oWord.visible = .t.
>>
>> MESSAGEBOX("I will wait here while you create some text and such in the new
>> word document." ; + CHR(13) + "Click OK when you are ready to
>> proceed with the Search and Replace.", ;
>> 64, "READY TO PROCEED?")
>> SearchReplaceInDoc(g_oWord.activedocument)
>>
>> *************************
>> PROCEDURE SearchReplaceInDoc(tcDoc)
>> *************************
>> #DEFINE wdEvenPagesHeaderStory 6
>> #DEFINE wdPrimaryHeaderStory 7
>> #DEFINE wdEvenPagesFooterStory 8
>> #DEFINE wdPrimaryFooterStory 9
>> #DEFINE wdFirstPageHeaderStory 10
>> #DEFINE wdFirstPageFooterStory 11
>>
>> LOCAL loRange, loSection, loHeaderFooter, llCheck, lcOld, lcNew
>>
>> lcOld = "Retirer"
>> lcNew = "Essais"
>>
>> FOR EACH loRange IN tcDoc.StoryRanges
>> IF !INLIST(loRange.StoryType, wdEvenPagesHeaderStory,
>> wdPrimaryHeaderStory, ; wdEvenPagesFooterStory,
>> wdPrimaryFooterStory, wdFirstPageHeaderStory, ;
>> wdFirstPageFooterStory)
>> SearchReplaceInRange(loRange, lcOld, lcNew)
>>
>> DO WHILE !ISNULL(loRange.NextStoryRange)
>> loRange = loRange.NextStoryRange
>> SearchReplaceInRange(loRange, lcOld, lcNew)
>> ENDDO
>>
>> ENDIF
>> NEXT
>>
>> FOR EACH loSection IN tcDoc.Sections
>> FOR EACH loHeaderFooter IN loSection.Headers
>>
>> llCheck = loHeaderFooter.LinkToPrevious
>> IF NOT llCheck
>> SearchReplaceInRange(loHeaderFooter.RANGE, lcOld, lcNew)
>> ENDIF
>>
>> NEXT
>>
>> FOR EACH loHeaderFooter IN loSection.Footers
>>
>> llCheck = loHeaderFooter.LinkToPrevious
>> IF !llCheck
>> SearchReplaceInRange(loHeaderFooter.RANGE, lcOld, lcNew)
>> ENDIF
>>
>> NEXT
>> NEXT
>> ENDPROC
>>
>> *************************
>> PROCEDURE SearchReplaceInRange(tcRange, tcOld, tcNew)
>> *************************
>> tcRange.FIND.Execute(tcOld,.F.,.T.,.F.,.F.,.F.,.T.,0,.T.,tcNew,2)
>> ENDPROC
>>
>> Guy BONEMME a formulé ce lundi :

--
Merci de partager avec moi votre immense savoir que je me ferai plaisir
d'absorber...
il va de soi que je vais vous en laisser un peu
Politesse et savoir vivre oblige ;0)
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000015911
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3