Bonjour,
J'ai fait la superbe fonction si dessous pour lancer le correcteur orthographique de word dans une page web, il me reste un petit problème à résoudre, c'est que si le texte envoyé contient des balises html, word essaye de les corriger alors que je voudrais qu'il les ignore. QQ'un verait il un moyen de lui spécifier que le texte envoyé est du html?
function checkspell()
Dim oShell
Set oShell = CreateObject("Wscript.Shell")
Dim myText, oWindow, oDocument, oSelect, oSelectRange
const wdDoNotSaveChanges = 0
myText=document.formname.Editeur_Texte.Value
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
FillTextArea(RangeCorrected)
set document.formname.Editeur_Texte.Value = RangeCorrected
End If
oWD.Quit wdDoNotSaveChanges
Set oDoc = Nothing
Set oWD = Nothing
End Function