nca_word


Ancestor

nonvisualobject

Library

word.pbl

Description

This object provides an interface into the Word 97 Application for useful functions such as Spell Checking and Grammar Checking. The interface to Word 97 is through OLE Automation.

Usage

Use this object to add spell checking and grammar checking features to your application. This ibject is auto instanciate so just declare the object and call the public function of your choice.

Model

nca_word
Private:
Boolean ib_CheckReg
Boolean ib_Word97
boolean checkreg ()
integer fileopen (ref string as_text)
integer grammarcheck (ref string as_text)
boolean isword ()
integer lastpos (string as_string, string as_value)
(none) replacechar (ref string as_String, string as_From, string as_To)
integer spellcheck (ref string as_text)
integer splitdirfile (string as_path, ref string as_dir, ref string as_filespec)
integer thesaurus (ref string as_text)
integer wordcount (string as_Text)

Functions


checkreg

Description This function checks the registry to see if the Word OLE Automation entries are available and that atleast Word 97 or better is available.

Return boolean
  • TRUE - Word is available
  • FALSE - Word is not available

  • Access protected

    Arguments (none)
    Usage lb_CheckReg = this.CheckReg()


    fileopen

    Description This function uses the Word Dialog function to open the File Open dialog. The file choosen by the user replaces the default directory passed in. For best effect only pass in the path to the default file, otherwise word will give unpredicatable results that will confuse your user!

    Return integer
  • 1, All ok
  • -99, User Pressed Cancel
  • else, function failed

  • Access public

    Arguments
    Argument DataType Description
    as_text string Default Path/Choosen File.

    Usage lnca_Word.fileOpen( ls_File )


    grammarcheck

    Description This function uses the Word Grammar Checking functions to grammar check the contents of the passed string. The corrected string replaces the passed string.

    Return integer
  • 1, All ok
  • else, function failed

  • Access public

    Arguments
    Argument DataType Description
    as_text string Text to be grammar checked.

    Usage lnca_Word.GrammaCheck( ls_Words )


    isword

    Description Function Returns whether the word is availabel for OLE Automation functions.

    Return boolean
  • TRUE - Word available.
  • FALSE - Word not available or version is out of date.

  • Access public

    Arguments (none)
    Usage lnac_Word.IsWord()


    lastpos

    Description Return the loast position of a substring in a string

    Return integer
    position in the string

    Access protected

    Arguments
    Argument DataType Description
    as_string string Locate in this string
    as_value string What to find

    Usage li_Pos = this.LastPos( 'bob', 'b' )


    replacechar

    Description Replace a String with a String. This function is inlined for speed but you could replace this with a call to your class library equivalent.

    Return (none)


    Access protected

    Arguments
    Argument DataType Description
    as_String string String to replace the characters in.
    as_From string String of characters to replace
    as_To string String of characters to change to

    Usage this.ReplaceChar( ls_Str, '~r~n', '~r' )


    spellcheck

    Description This function uses the Word Spell Checking functions to spell check the contents of the passed string. The corrected string replaces the passed string.

    Return integer
  • 1, All ok
  • else, function failed

  • Access public

    Arguments
    Argument DataType Description
    as_text string Text to be spell checked.

    Usage lnca_Word.SpellCheck( ls_Words )


    splitdirfile

    Description Split a Full filename and path into the dir and the file spec. For example C:\*.* would be split into C:\ and *.*

    Return integer
  • 1, processed ok
  • -1, error spliting path

  • Access public

    Arguments
    Argument DataType Description
    as_path string Full path to split out.
    as_dir string The Dir portion of the path.
    as_filespec string The Filespec of the path.

    Usage this.SplitDirFile( ls_Path, ls_Dir, ls_FN )


    thesaurus

    Description This function uses the Word Dialog function to open the Thesaurs dialog. The choosen word replaces the passed string.

    Return integer
  • 1, All ok
  • else, function failed

  • Access public

    Arguments
    Argument DataType Description
    as_text string Default/Choosen Word.

    Usage lnca_Word.Thesaurs( ls_Word )


    wordcount

    Description This function uses the Word Dialog function to open the Word Count dialog. The text passed into the function is analysed by the word count dislag.

    Return integer
  • 1, All ok
  • else, function failed

  • Access public

    Arguments
    Argument DataType Description
    as_Text string Text to be counted.

    Usage lnca_Word.WordCount( ls_Word )

    Events


    constructor

    Description Initialsze object settings.


    See Also

    (none)


    Generated by PB2HTML. ( Unregistered Version )