Hi all,
I have a Word macro that works quite nicely when run in Word. The catch is that I want to write into a VBScript that is run from the browser. This script opens Word, writes some stuff in it and then, I want it to run my little macro. I really want to write the macro in the script instead of just having the script call the macro. (Because other people will use the script and I can't run around installing the macro on everyone's machines.)
So, here is my macro. Any advice in getting into VBscript would help. (The := construction is a problem, as is aWord.)
Sub TestMacSpell()
ActiveDocument.Bookmarks.Add Name = "temp", Range = Selection.Range
For Each aWord In ActiveDocument.Words
If Not Application.CheckSpelling(aWord.Text, CustomDictionary = "CUSTOM.DIC", IgnoreUppercase:=False) Then
aWord.Font.Color = wdColorRed
End If
Next aWord
ActiveDocument.Bookmarks("temp"
.Select
ActiveDocument.Bookmarks("temp"
.Delete
End Sub
Thanks,
Ann
I have a Word macro that works quite nicely when run in Word. The catch is that I want to write into a VBScript that is run from the browser. This script opens Word, writes some stuff in it and then, I want it to run my little macro. I really want to write the macro in the script instead of just having the script call the macro. (Because other people will use the script and I can't run around installing the macro on everyone's machines.)
So, here is my macro. Any advice in getting into VBscript would help. (The := construction is a problem, as is aWord.)
Sub TestMacSpell()
ActiveDocument.Bookmarks.Add Name = "temp", Range = Selection.Range
For Each aWord In ActiveDocument.Words
If Not Application.CheckSpelling(aWord.Text, CustomDictionary = "CUSTOM.DIC", IgnoreUppercase:=False) Then
aWord.Font.Color = wdColorRed
End If
Next aWord
ActiveDocument.Bookmarks("temp"
ActiveDocument.Bookmarks("temp"
End Sub
Thanks,
Ann