vince1303
Messages postés30Date d'inscriptionvendredi 18 mars 2005StatutMembreDernière intervention18 septembre 2008
-
7 mars 2008 à 11:18
vince1303
Messages postés30Date d'inscriptionvendredi 18 mars 2005StatutMembreDernière intervention18 septembre 2008
-
7 mars 2008 à 11:27
vince1303
Messages postés30Date d'inscriptionvendredi 18 mars 2005StatutMembreDernière intervention18 septembre 2008 7 mars 2008 à 11:27
Bonjour,
J'essaye de faire un correcteur d'orthographe s'appuyant sur word pour un editeur de texte "web" reposant sur un textarea.
J'ai 2 problèmes :
1 - Le correcteur corrige bien les fautes (1), mais le texte n'est jamais renvoyé au textarea (2)
2 - Comment dire à word de ne pas essayer de corriger les balises HTML de mise en forme du texte.
La fonction appelée
function checkspell()
Dim oShell
Set oShell = CreateObject("Wscript.Shell")
Dim oWD, oDoc, RangeOriginal, RangeCorrected, Cnt, Status
Set oWD = CreateObject("Word.Application")
oWD.Visible =false
Set oDoc = oWD.Documents.Add
On Error Resume Next
oWD.Selection.TypeText myText
Set RangeOriginal=oWD.ActiveDocument.Range(0,oWD.Selection.End)
If oWD.CheckSpelling(RangeOriginal)=False Then
oWD.ActiveDocument.CheckSpelling
Set RangeCorrected = oWD.ActiveDocument.Range(0,oWD.Selection.End)
RangeCorrected.copy
MsgBox(RangeCorrected)
document.formname.Editeur_Texte.Value = RangeCorrected
End If
oWD.Quit wdDoNotSaveChanges
Set oDoc = Nothing
Set oWD = Nothing