Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

deleting unknown words in MS Word

bitWISErbitWISEr Member Posts: 45
Hi there,
in fact I'm a c++ coder, but i need a vbscript for
MS Word that deletes all words (from a wordlist), that
are unknown to the spell-checking...
can anybody help me?
THNX

bitWISEr

Comments

  • leeosleeos Member Posts: 1,212
    : Hi there,
    : in fact I'm a c++ coder, but i need a vbscript for
    : MS Word that deletes all words (from a wordlist), that
    : are unknown to the spell-checking...
    : can anybody help me?
    : THNX
    :
    : bitWISEr

    Not really into the script thing.. but you could adapt this.

    [code]
    Dim objword As Word.Application ' remember to add your word reference
    Dim FileName As String ' path and filename
    Dim j As Long

    Static myKeywords(0 To 3) ' increase as you add my keywords
    myKeywords(0) = UCase("John_Leslie")
    myKeywords(1) = UCase("Drinking")
    myKeywords(2) = UCase("Prohibition")

    Set objword = CreateObject("Word.Application")

    FileName = "c: emplee.doc" ' modify to your doc name.

    objword.Documents.Open FileName

    Do Until j = 4

    If InStr(1, UCase(objword.ActiveDocument.Content), myKeywords(j)) > 1 Then
    Debug.Print myKeywords(j) & " " & "Exists In " & FileName

    ' you need to use the Replace Function here...

    End If

    j = j + 1

    Loop

    objword.ActiveDocument.Close (False) ' dont save changes if it as old version of word

    objword.Quit

    Set objword = Nothing
    [/code]

  • bitWISErbitWISEr Member Posts: 45
    Err this code looks like I have to write a list
    of words that exist, but that is exactly, what
    I want to avoid, I want to use the spell checking
    list from MS Word...
    THNX & CU
    ________
    bit[b][red]WISE[/red][/b]r

  • leeosleeos Member Posts: 1,212
    : Err this code looks like I have to write a list
    : of words that exist, but that is exactly, what
    : I want to avoid, I want to use the spell checking
    : list from MS Word...
    : THNX & CU

    mmm. sorry, but you did say word list. anyway.. look up the docs on spell checking in word with vb. i just looked on google.com

    it is not difficult to understand.

    regards

    dr k. groomgargler

  • Shawn CarterShawn Carter Member Posts: 0

    _______ || http://forcoder.org || free video tutorials and ebooks about { Delphi Python Assembly R PL/SQL C Swift Objective-C PHP Scratch Ruby MATLAB Visual Basic .NET Perl Visual Basic JavaScript C# C++ Java Go F# Alice SAS Lisp Dart Kotlin Clojure Prolog Hack Lua Ada FoxPro LabVIEW Julia D Logo Erlang Fortran Crystal VBScript Scheme Apex Scala ML Awk Bash COBOL Transact-SQL ABAP Rust }

Sign In or Register to comment.