CapeSoft.Com
Clarion Accessories
Office Inside
Documentation
Word
CapeSoft Logo

CapeSoft Office Inside
Word Documentation

Download Latest Version JumpStart FAQ History
Installed Version Latest Version

Jump Starts to Using Word in your application:

Manipulating a Word doc from within your application

  1. Load your application
  2. Add the Office Inside global extension template
  3. Right-click on the procedure that you will use to control word (this needs to at least be a window in order to include an event handler) and choose Extensions
  4. Click Insert. Choose Add_MSWord_Object and click Select.
  5. You now have the ability to edit a word document from within that procedure. From here, the best is to use the offdemo application (particularly the Word_Main procedure) which will give you an idea of (a) what you can do and (b) how to do it. Consult the class section of this document which will show you how to use the various methods and properties of the oiWord class.

Adding Spell Checking to your application

  1. Load your application
  2. Choose Template Utility from the IDE's Application menu
  3. Choose ShowSpellingSuggestionsABC (found under Class OfficeInside), and click the Select button. You should now see a new procedure in your application called oiShowSpellingSuggestions. This window is called by Office Inside when it checks your spelling from within other procedures in your application.
  4. Select the procedure(s) in your application that you want to add Spell Checking support to
  5. Right-click on the procedure and choose Extensions
  6. If you already have an Add an MS Word object to this procedure extension template listed for this procedure, skip to point 8, otherwise:
  7. Click Insert. Choose Add_MSWord_Object and click Select.
  8. Select the Add an MS Word object to this procedure extension, and then click the Insert button
  9. Choose Word_SpellChecking and click the Select button. At this point, there are a number of template options you can change, namely - overriding the default alert key, Include specific controls (or exclude specific controls) using the template prompts.
  10. Click OK and compile your application!
Important Information!!!!
A Checkbox has been added to the Global Extension that should be checked in order to use spell checking on a Clarion 6 RTF control. See the section below on C6 RTF controls for instructions on changing the required RTF class property.

If you're not sure how to add an RTF control to your window, take a look at the FAQ section below.

Exporting a report to Word

  • If you have not done so already, add the OfficeInside global extension to your application
  • If this is a Legacy application, then you must check the "Enable the use of ABC classes" checkbox in the Global Properties of your Application on the Classes tab.



  • In the extension templates of the Report procedure that you want to export to Excel, add the  "Add_MSWord_Object" template to the templates there. In the template prompts, select "Reports" from the Template Type.



    If you have a FileExplorer extension added to this procedure, then check the "Activate compatibility with file Explorer" checkbox, and ensure the "Base Class" is set to "oiWord".

    On the Report Type tab, there are a number of options you can set:

  • Report Type should be set to Editable
  • You can select to include the Header and Footer on Every Page, Once (at the top for the header or bottom for the footer), or never.

    On the Options tab, you can set:

  • The output file name (you can make this a variable by checking the "file name is a variable" checkbox and entering a variable name. You should not include the doc or docx extension though, as OfficeInside will populate this correctly depending on which version of Excel is installed on your user's PC.
  • Save to EXE folder is self explanatory as is open Word Doc once generated.

    Select the report’s Procedure from the Procedure Tree. Press the Properties Button. Press the Actions Button. Press the Report Properties Button. On the Report Target Tab, select for Report Target, “Ask at Runtime.”


  • or if you prefer, you can stipulate to use Word as the other target.

    Using Mail Merge

    In this context the term mail merge is a word doc with a number of "Field"s in it that are replaced with values from the data base and either printed, emailed or saved as multiple documents when the Merge is "Finished". Typically your Word Doc would look something like:


    You can also Create the Mail Merge Document at runtime

    You will notice in the document that there are 3 fields used: <<First_Name>>, <<Last_Name>> and <<Email_Address>>. These 3 fields exist in your datasource. Your datasource would typically be a csv file that would contain at least these 3 fields:



    The first line of your CSV file must contain the field names that will be used in the Word Doc to identify the fields in your data source. If you have a new Word doc and you have not yet registered your datasource, then you need to use the Mailings tab and Select Recipients button to select the data source file from which to glean the data from (you can use the MailMergeSetDataSource method to get OfficeInside to do this from within your application).



    To use the fields from your datasource in the Word Doc, you need to use the Mailings tab and Insert Merge Field button, and all the fields of your datasource will be listed.



    If you need to add more fields to the datasource file, you need to first close MS Word, before editing your datasource file. The next time that you open your Word Doc for editing, your new field(s) will be available for use in the master document.

    NOTE: Spaces in your datasource's field name get changed to _ character in the Merge Field name

    To control your Mail Merge doc from your Clarion application here's what you need to do:
    1. If you have not done so already, add the OfficeInside global extension to your application.
    2. In the extension templates of procedure from where you'll be controlling the sending of the mail merged document, add the  "Add_MSWord_Object" template to the templates there. In the template prompts, select "Mail Merge" from the Template Type.

      On the Init tab, decide if you want to display the Word doc or not (check "Make Word Visible" if you do), and leave the other options to their defaults.

      On the Open tab, set the Filename to the name of the Word Doc that you want to use for the mail merge (note: it must contain the fully qualified path):



      On the Data tab, choose a DataSource Type, and the name of the DataSource (if you are using a variable, then you must make sure that your variable is set to point to the correct datasource file before the template embed code uses it)  (note: it must contain the fully qualified path):

        This could also be an xls file (for type csv).

      On the Settings tab, choose the Merge type (Email/Printer/New Document) from the "Merge To" drop down.

      If you select Email, then you need to set the "Email Address field name" (the field name in the data source used for the email address) and the "Email Subject".

      On the Merge tab, you can select the event that triggers the Mail Merge (you can use a control in your procedure, as the window opens, or a handcoded event).

      On the Close tab, select the trigger to close the Mail Merge document.

      NOTE: If you have a dotx file (template file) that you want to use for the mailmerge (to add the mailmerge at runtime), then you must close the dotx and save the new mailmerge doc as a docx in order to ensure that the dotx file does not remain attached to the csv file for the mailmerge addresses.

    Creating the Mail Merge Document at runtime

    In order to convert an existing word document to a mail merge document, we need to do the following things:
    1. Assign the Datasource. You do this using the MailMergeSetDataSource(DataSourceFileName) method.
    2. Add the datasource fields into the document. This will be done at the current selection, so you must first use the SetSelection method to set the selection to the correct position in the document. Use the MailMergeInsertField(FieldName) method to add the datasource fields into the document.
    3. Email or Print the MailMerge. You do this using the MailMergeEmail or MailMergePrintmethods.

    Converting a Word Macro into your application

    Microsoft have developed a scripting language that allows you to automatically perform a sequence of tasks in Word. The sequence of commands is called a macro. Unfortunately (as of writing this doc using Word 2010), you are not able to use the right-click menu during Macro Recordings, which inhibits you from generating a lot of macro functionality. However, you are still able to do a number of tasks using the menu items. First thing is to record a macro in Word and then we'll work through converting the generated VB script code in the following manner:

    In your word doc, from the View menu, select the Record Macro in the Macros drop down:



    The Record Macro item now changes to a Stop Recording item. When you have finished the sequence of instructions that you're wanting to perform, click the Stop Recording item, and then use the View Macros to show the macro that you've just recorded. Highlight the macro you just recorded, and click the Edit button



    Now follow the steps in  Converting macro code to Clarion code to convert your macro code to Clarion code.

    Templates

    Add_MSWord_Object

    Summary

    Procedure Extension Template
    Add an MS Word object to a procedure

    What does it do?

    This template is used to add MS Word functionality to a procedure in your app. We are still developing it and adding functionality to it, more info will come later.

    Prerequisites

    You need to have added the Activate_Office_Inside global extension template before you can add this template to a procedure.

    Editable Reports (Word and Excel report output)

    Legacy Users: If you are using Legacy and would like to use the Editable Report Word and Excel templates you need to ticked on "Enable the use of ABC classes" checkbox under Global Settings on the Classes tab.
    1. Add the Local extension to a Report procedure (See "How do I implement it" below), and from the Template Type dropdown select "Reports"
    2. Click OK, and then select Generate from the Project menu
    3. Go to the Properties for the report procedure and click on the Report Properties option.
    4. Select the Report Target tab and either select "Ask at Runtime" or "other" from the Report Target dropdown. If you select Ask at Runtime, then user will be prompted. If you select Other you can choose the report output type from the Other Target dropdown.
    How do I implement it?
    1. Select the procedure which you want to add this template to.
    2. Select "Properties..." from the "Edit" menu
    3. Click the "Extensions" button
    4. Click on the "Insert" button to add a new extension template
    5. Select "Add_MSWord_Object" ( found under the "Class OfficeInside" group )
    6. Click "Select", then "OK", then "OK" again...
    What are my options?

    Classes

    This section describes the various classes which make up "Office Inside".  Each class contains methods and properties, which are documented below. Each method is documented by giving the method name, the parameters, an example of how to code the method, a list describing what the method does, and additional comments below.

    The oiWord Class - Introduction

    The oiWord class is a "wrapper" class, which is used by the templates and by other classes as the "communication" layer between Office Inside and MS Word. Should you wish to write code which communicates "directly" with MS Word, this is the class you're looking for.

    oiWord Class Methods

    See Properties as well.
    New Methods (also listed below)
    SpellCheckStringSpell checks a passed string
    SpellCheckHtmlSpell checks HTML contents (ignores tags, script etc.)
    SpellWordSpell checking callback
    ProtectEnables document protection
    UnprotectRemoves document protection
    PageSetup (Beta)(3.0.2) Allows all Page Setup options to be set
    DeleteSelection Deletes the current selection
    RefreshDocsRefreshes the Documents queue
    Class Methods
    AlignCenterAlign the current selection centre on the page
    AlignJustifySet the alignment for the current selection to Justified (tries to stretch the text to the edges of it's container)
    AlignLeftSet the alignment for the current selection to left aligned
    AlignRightSet the alignment for the current selection to left aligned
    BoldMake the selected text bold
    CentimetersToPointsConvert a number from Centimeters to Points
    CheckGrammarCheck the Grammar of a passed string
    CheckSpellingCheck the Spelling of a passed string
    CheckSpelling_AddToIgnoredWordsAdds a word to the Ignored list when spell checking
    CheckSpelling_IsWordIgnoredChecks if a word is in the Ignored list when spell checking
    CloseDocCloses the current document
    CloseFooterCloses the footer if it is open (returns to editing the main document)
    CloseHeaderCloses the header if it is open (returns to editing the main document)
    CopyCopies the current selection to the clipboard
    CountCharactersCounts the number of characters in the current selection
    CountOpenDocsCounts the number of open documents in this instance of Word
    CountTablesCount the number tables in the current document
    CutCuts the current selection out of the document and places it on the clipboard
    DocumentStatisticsProvides document stats (page count, word count etc.)
    DeleteSelectionDeletes the current selection
    ErrorTrapCalled when an error occurs
    FindTextSearches the document for a specified string
    GetFileNameReturns the current document file path and name
    GetFontColorGets the font color of the current selection
    GetFontNameGets the font name of the current selection
    GetFontNamesFills a queue with all available fonts
    GetFontSizeGets the font size of the current selection
    GetInfoRetrieves various properties about Word and the document
    GetNameOfDictionaryGets the currently selected dictionary name
    GetObjectsGets the handles to the main COM objects you'll need to use when controlling Word directly using the COM objects.
    GetSelectionEndReturns the position that the current selection starts at
    GetSelectionStartReturns the position that the current selection ends at
    GetTextReturns the text in the current selection
    GotoEndOfDocMoves the cursor to the end of the document
    GotoItemMoves the cursor to the specified item (and optionally extends the current selection)
    HideToolbarHides the Toolbar in Word
    InchesToPointsConverts a number from inches to points
    InitInitialises the Word object and start Word if it is not already started.
    InsertBreakInserts a break in the document.
    InsertPictureInserts a picture in the document.
    InsertTableInserts a table in the document.
    InsertTextInserts text in the document.
    InsertTextboxInserts a text box in the document.
    ItalicMakes the font of the current select to italic.
    KillKills the Word object
    LinesToPointsReturns the height of the passed number of lines in the document in points
    MailMergeEmailExecute the Mail merge to send emails to the datasource recipients.
    MailMergePrintExecute the mail merge to the printer
    MailMergeInsertFieldInsert one of the MailMerge fields
    MailMergeRunStarts the mail merge (printing)
    MailMergeSetDataSourceSets the data source for a mail merge
    MillimetersToPointsConverts from millimeters info points
    MoveDownMoves the cursor down
    MoveLeftMoves the cursor left
    MoveRightMoves the cursor right
    MoveUpMoves the cursor up
    NewDocCreates a new document
    NextLineMoves to the next line
    OpenDocOpens an existing document
    OpenFooterOpens the document footer for editing
    OpenHeaderOpens the document header for editing
    PageSetupAllows all Page Setup options to be set for the document
    PastePastes the contents of the clipboard into the document
    PicasToPointsConverts from Picas to Points
    PixelsToPointsConverts from Pixels to Points
    PointsToCentimetersConverts from Points to Centimeters
    PointsToInchesConverts from Points to Inches
    PointsToLinesConverts from Points to Lines
    PointsToMillimetersConverts from Points to Millimeters
    PointsToPicasConverts from Points to Picas
    PointsToPixelsConverts from Points to Pixels
    PrintMePrints the current document
    PrintOutExpanded Print method that exposes all Word print settings
    PrintPreviewDisplay a Print Preview of the document
    ProtectTurns on document protection
    RedoRedoes an action and has been Undone
    ReplaceTextReplaces a specified sting or all occurrences thereof
    RefreshDocsRefreshes the Documents queue
    RestoreSnapShotOfWindowPosRestores the window size and position to that which was saved
    RunMacro Run a macro
    SaveSaves the current document
    SaveAsSave the document as a new file
    SetBackgroundSets the background color
    SetAlertsEnabled or disables the display of dialogues to the user by Word
    SetFontColorSets the currently used Font color
    SetFontNameSets the currently used Font name
    SetFontSizeSets the currently used Font size
    SetPageViewChange the type of page view
    SetParagraphFormattingSets the paragraph formatting for the current selection
    SetStyleSet the style of the selection (to the style name, e.g. Heading 1)
    SetScreenUpdatingTurns screen updating (redraw) on or off
    SetSelectionSets the current selection in the document
    ShowMessageDisplays a message to the user
    ShowToolbarUnhides the toolbar in Word
    ScreenRefreshRedraws the Word window if screen updating is off
    SetPrinterSets the printer for the current document
    SpellCheckStringSpell checks a passed string
    SpellCheckHtmlSpell checks HTML contents (ignores tags, script etc.)
    SpellWordSpell checking callback
    TableAutoFormatAutomatically formats a table using one of the styles that Word provides/
    TableCountColumnsCounts the number of columns in a table
    TableCountRowsCounts the number of rows in a table
    TableGetCellBackgroundColorGets the background color of the current cell
    TableGetCellForegroundColorGets the foreground color of the current cell
    TableGetCellTextureGets the texture selection for the current cell
    TableGetColumnWidthGets with width of the selected column in a table
    TableGetInsideBordersLineStyleGets the border line style for a table
    TableGetOutsideBordersLineStyleGets the border line style for a table
    TableInsertRowAtEndAdds a row to the end of a table
    TableMergeSelectedCellsMerges the selected cells in a table
    TableSetCellAlignCenterSets the cell alignment to center
    TableSetCellAlignJustifySets the cell alignment to justify
    TableSetCellAlignLeftSets the cell alignment to left
    TableSetCellAlignRightSets the cell alignment to right
    TableSetCellBackgroundColorSets the cell background color
    TableSetCellBoldSets the Bold attribute of the current cell's text
    TableSetCellFontColorSets the font color for the current cell's text
    TableSetCellFontNameSets the font face for the current cell's text
    TableSetCellFontSizeSets the font size for the current cell's text
    TableSetCellForegroundColorSets the foreground color for the current cell (for patterns)
    TableSetCellItalicMakes text in the current cell italic
    TableSetCellTextureSets the texture (image) used for the current cell background
    TableSetCellUnderlineSets text in the current cell to underlined
    TableSetColumnWidthSets the width of a column in a table
    TableSetInsideBordersLineStyleSets the border line style for a table
    TableSetOutsideBordersLineStyleSets the border line style for a table
    TableUpdateAutoFormatUpdates the automatic formatting and applies it to any new rows or columns that may have been added and not have had the formatting applied.
    TableWriteToCellWrites text into a cell in a table
    TakeEventCalled each time an event occurs in Word if Event Callbacks are on
    TakeSnapShotOfWindowPosSaves the current state of the Word window, allowing it to be restored later
    UnderlineSets the current selection's underline attribute
    UndoUndoes the last action
    UnprotectTurns of document protection
    UpdateUpdates a property of the Word application or the current document

    AlignCenter

    AlignCenter( ) ,byte,proc

    Description Example
    Example
    MyWord.AlignCenter ()
    TempByte = MyWord.AlignCenter ()

    AlignJustify

    AlignJustify ( ) ,byte,proc

    Description Example
    Example
    MyWord.AlignJustify ()
    TempByte = MyWord.AlignJustify ()

    AlignLeft

    AlignLeft ( ) ,byte,proc

    Description
    Example
    Example
    MyWord.AlignLeft ()
    TempByte = MyWord.AlignLeft ()

    AlignRight

    AlignRight ( ) ,byte,proc

    Description Example
    Example
    MyWord.AlignRight ()
    TempByte = MyWord.AlignRight ()

    Bold

    Bold  ( byte pOption=oiw:BoldToggle ) ,byte,proc

    Description Example
    Example
    MyWord.Bold (oiw:BoldOn)
    TempByte = MyWord.Bold (oiw:BoldOn)

    CentimetersToPoints

    CentimetersToPoints ( string pCentimeters ) ,string

    Description Example
    Example
    loc:Points = MyWord.CentimetersToPoints(1.5)
    MyWord.Update(oiw:PageLeftMargin, MyWord.CentimetersToPoints(1.5))

    CheckGrammar

    CheckGrammar ( *string pText ) ,byte

    Description Example
    Example
    TempByte = MyWord.CheckGrammar (StringVar)

    CheckSpelling

    CheckSpelling     ( string pText, byte pSilent ) ,byte,proc

    Description Example
    Example
    StringVar = 'This is spelld wrongg'
    TempByte = MyWord.CheckSpelling (StringVar)

    if MyWord.CheckSpelling (loc:Var1, false, false) = true
      loc:Var1 = MyWord1.TempCString
      ...

    CheckSpelling_AddToIgnoredWords

    CheckSpelling_AddToIgnoredWords ( string pText ) ,byte,proc

    Description Example
    Example
    MyWord.CheckSpelling_AddToIgnoredWords ('CapeSoft')

    CheckSpelling_IsWordIgnored

    CheckSpelling_IsWordIgnored ( string pText ) ,byte,proc

    Description Example
    Example
    if MyWord.CheckSpelling_IsWordIgnored ('CapeSoft') = true
    ...

    CloseDoc

    CloseDoc ( ) ,byte,proc

    Description Example
    Example
    MyWord.CloseDoc()
    TempByte = MyWord.CloseDoc()

    CloseFooter

    CloseFooter ( ) ,byte,proc

    Description Example
    Example
    MyWord.CloseFooter()

    CloseHeader

    CloseHeader ( ) ,byte,proc

    Description Example
    Example
    MyWord.CloseHeader()

    Copy

    Copy ( ) ,byte,proc

    Description Example
    Example
    MyWord.Copy()
    TempByte = MyWord.Copy()

    CountCharacters

    CountCharacters (  ) ,long

    Description Example
    Example
    TempLong = MyWord.CountCharacters ()

    CountOpenDocs

    CountOpenDocs (  ) ,long

    Description Example
    Example
    TempLong = MyWord.CountOpenDocs()

    CountTables

    CountTables (  ) ,long

    Description Example
    Example
    TempLong = MyWord.CountTables ()

    DocumentStatistics

    DocumentStatistics (long statistic), long

    Description

    Loads the entire contents of a file into a string. If the string passed is not large enough the required size is returned.

    Parameters
    Parameter Description
    long statistic Indicates the statistic to be retrieved. Must be one of the following values:
    • oiw:StatisticCharacters: Count of characters.
    • oiw:StatisticCharactersWithSpaces: Count of characters including spaces.
    • oiw:StatisticFarEastCharacters: Count of characters for Asian languages.
    • oiw:StatisticLines: Count of lines.
    • oiw:StatisticPages: Count of pages.
    • oiw:StatisticParagraphs: Count of paragraphs.
    • oiw:StatisticWords: Count of words.

    Return Values

    The method returns -1 for failure, or the requested statistic if it succeeds.

    Example
    Example
    numWords		long
    pExcel			class(oiExcel)
    			end
      code
        numWords = pExcel.DocumentStatistics(iw:StatisticWords)
        if numWords < 0
            Message('Could not fetch the word count.')
        else
            Message('The document contains ' & numWords & ' words.')
        end
    See Also

    StringToFile - write the content of a string to a file on disk.

    Cut

    Cut ( ) ,byte,proc

    Description Example
    Example
    MyWord.Cut()
    TempByte = MyWord.Cut()

    FindText

    FindText (string pText), long

    Description

    Searches the document for the passed strings and returns 1 and selects the string if found, or returns zero and does not change current selection if the string does not exist in the document. This can be called multiple times to find each instance of the string in the document (for example to make each instance of the string bold - see the example below).

    Note: Each subsequent call will find and highlight the next text in the document, so it's important to note that the exact same FindText call might return 0 if there are no subsequent strings of that nature in the document.

    Parameters
    Parameter Description
    string pText The string to search for in the document
    Return Values

    Returns 1 if successful and selects the string that was found, or if the string cannot be found it returns zero.

    Examples
    Example
    ! Find all instances of the word 'Hello' and make them bold.
    loop while
    myWord.FindText('Hello ')
        myWord.Bold(oiw:BoldOn)
    end

    GetFileName

    GetFileName (), string

    Description

    Returns the full path and name of the current file. If the document has not been save, it will return the name of the document, such as 'Document1'.

    Parameters

    None

    Return Values

    Returns the full path and name of the current document on disk, for example 'C:\Documents\Personal\Accounts.doc'. If there is an error, or not document has been opened then a blank string is returned. If the current document has not been saved (and hence does not exist on disk) then the current name of the document is returned, for example: 'Document1'

    Examples
    Example
    Message('Current document file name is: ' & myWord.GetFileName)

    ErrorTrap

    ErrorTrap( string pErrorString, string pFunctionName )

    Description Example
    Example
    MyWord1.ErrorTrap PROCEDURE (string pErrorString, string pFunctionName) 
      code
        parent.ErrorTrap(pErrorString, pFunctionName)
       
    if pErrorString = 'Init Failed'
           
    Message('Could not initialise Word! Please ensure that MS Word is installed.')
        end

    GetFontColor

    GetFontColor ( ) ,long

    Description Example
    Example
    TempLong = MyWord.GetFontColor()

    GetFontName

    GetFontName ( ) ,string

    Description Example
    Example
    TempString = MyWord.GetFontName()

    GetFontNames

    GetFontNames (  ) ,byte,proc

    Description Example
    Example
    MyWord.GetFontNames ()

    GetFontSize

    GetFontSize ( ) ,long

    Description Example
    Example
    TempLong = MyWord.GetFontSize()

    GetInfo

    GetInfo ( byte pOption ) ,string,proc

    Description Example
    Example
    TempString = MyWord.GetInfo (oiw:GetUserName)

    GetNameOfDictionary

    GetNameOfDictionary ( ) ,string

    Description Example
    Example
    TempString = MyWord.GetNameOfDictionary()

    GetObjects

    GetObjects( ) ,long

    Description Example
    Example
    TempLong = MyWord.GetObjects()

    GetSelectionEnd

    GetSelectionEnd ( ) ,long

    Description Example
    Example
    TempLong = MyWord.GetSelectionEnd()

    GetSelectionStart

    GetSelectionStart ( ) ,long

    Description Example
    Example
    TempLong = MyWord.GetSelectionStart()

    GetText

    GetText ( byte pScope=oiw:GetText_All ) ,byte,proc

    Description Example
    Example
    if MyWord1.GetText (oiw:GetText_CurrentSelection) = true
      stop(MyWord1.TempCString)
    end

    GotoEndOfDoc

    GotoEndOfDoc ( ), byte, proc

    Description

    Moves the cursor to the end of the current document.

    Return Values

    Returns true (1) if no problems were experienced.

    Examples
    Example
    MyWord.GotoEndOfDoc()
    if not MyWord.GotoEndOfDoc()
        Message('
    Could not go to the end of the document, an error occured.')
    end

    GotoItem

    GotoItem(long  pItem, <long pDirection>, <long  pName>, <long pCount>), long, proc

    Description

    Moves the cursor to a location within the document, based on the parameters which you pass. Can be used to navigate to a position in the document based on a line, paragraph, bookmark, character position etc. The pItem parameter is used to specify which item to go to, and the pDirection parameter specifies which one of those items to go to (the first, last etc.). You can set the pDirection to oiw:GotoAbsolute and then use the pCount parameter to specify the number of the item to go to (for example the 4th line in a document).

    Note:
    If the pItem parameter is oiw:GoToBookmark, oiw:GoToComment, oiw:GoToField, or oiw:GoToObject, this parameter specifies a name and the pName field must be passed to specify which item is referred to.

    Parameters
    Parameter Description
    long pItemThe item to go to. Can be one of the GoTo equates:
    • oiw:GoToBookmark - goes to the bookmark specified by the pName.
    • oiw:GoToSection - goes to the section specified by the pDirection and pCount parameters.
    • oiw:GoToPage - goes to the page specified by the pDirection and pCount parameters.
    • oiw:GoToTable - goes to the table specified by the pDirection and pCount parameters.
    • oiw:GoToLine - goes to the line specified by the pDirection and pCount parameters.
    • oiw:GoToFootnote - goes to the footnote specified by the pDirection and pCount parameters.
    • oiw:GoToEndnote- goes to the endnote specified by the pDirection and pCount parameters.
    • oiw:GoToComment - goes to the comment specified by the pName.
    • oiw:GoToField - goes to the field specified by the pName parameter.
    • oiw:GoToGraphic - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToObject - goes to the comment specified by the pName parameters.
    • oiw:GoToEquation - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToHeading - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToSpellingError - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToGrammaticalError - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToPercent - goes to the comment specified by the pDirection and pCount parameters.
    • oiw:GoToProofreadingError - goes to the comment specified by the pDirection and pCount parameters.
    long pDirection Specifies which items to go to, can be used in combination with the pCount parameter. For example if pDirection is set to oiw:GoToPrevious, then the count parameter can specify how many previous to go to (setting it to 4 will go to 4 items previous to the current one). May be one of the following values:
    • oiw:GoToAbsolute - goes to a specific item, for example the 2nd table or 12th line in a document. Use the pCount parameter to specify which instance of the item to go to.
    • oiw:GoToFirst - goes to the first occurrence of the item specified by the pItem parameter (table, line, paragraph etc.)
    • oiw:GoToLast - goes to the last occurrence of the item specified by the pItem parameter (table, line, paragraph etc.)
    • oiw:GoToNext - goes to the next occurrence of the item specified by the pItem parameter (table, line, paragraph etc.). Can be use in conjunction with the pCount parameter to move that number of the specified items.
    • oiw:GoToPrevious - goes to the previous occurrence of the item specified by the pItem parameter (table, line, paragraph etc.). Can be use in conjunction with the pCount parameter to move that number of the specified items.
    • oiw:GoToRelative - moves the number of pItems indicated by the pCount parameter relative to the current item. For example can be used to go four lines down from the current one.
    Returns Values

    Returns true (1) if no problems were experienced and false (0) if an error occurs. In the case of an error the ErrorTrap method will be called with a string indicating what error occurred.

    Examples
    Example
    ! Go to the last line in the document
    MyWord.GotoItem(oiw:GoToLine, oiw:GoToLast)
    ! Go to a named bookmark
    MyWord1.GotoItem(oiw:GoToBookmark, , '
    FirstName')
    ! Go to the first footnote in the document
    MyWord1.GotoItem(oiw:GoToFootnote, oiw:GotoFirst)
    ! Move down 4 lines
    MyWord1.GotoItem(oiw:GoToLine, oiw:GotoRelative, , 4)
    ! move back two pages
    MyWord1.GotoItem(oiw:GoToPage, oiw:GotoPrevious, , 2)
    ! Move the insertion point just before the fifth endnote reference in the document
    MyWord1.GotoItem(oiw:GoToEndNote, oiw:GoToAbsolute, , 5)
    ! Move the selection to the first cell in the next table
    MyWord1.GotoItem(oiw:GoToTable, oiw:GotoNext)
    ! Select the Date field (assumes that there is a field in the document with the name Date)
    MyWord1.GotoItem(oiw:GoToField, , '
    Date')

    HideToolbar

    HideToolbar ( long pToolbar ) ,byte,proc

    Description Example
    Example
    MyWord.HideToolbar (oiw:ToolbarStandard)
    TempByte = MyWord.HideToolbar (oiw:ToolbarStandard)

    InchesToPoints

    InchesToPoints ( string pInches ) ,string

    Description Example
    Example
    loc:Points = MyWord.InchesToPoints(1.6875)
    MyWord.Update(oiw:PageLeftMargin, MyWord.InchesToPoints(1.6875))

    Init

    Init ( byte StartVisible=1, byte EnableEvents=1 ) ,byte,proc

    Description Example
    Example
    MyWord.Init()
    TempByte = MyWord.Init()

    InsertBreak

    InsertBreak ( long pBreakType=oiw:PageBreak ) ,byte,proc

    Description Example
    Example
    MyWord.InsertBreak ()
    MyWord.InsertBreak (oiw:PageBreak)
    MyWord.InsertBreak (oiw:TextWrappingBreak)

    InsertPicture

    InsertPicture ( string FileName ) ,byte,proc

    Description Example
    Example
    MyWord.InsertPicture ('c:\mypic.bmp')
    TempByte = MyWord.InsertPicture ('c:\mypic.bmp')

    InsertTable

    InsertTable ( long NumColumns, long NumRows ) ,long,proc

    Description Example
    Example
    MyWord.InsertTable (6, 3)
    TempByte = MyWord.InsertTable (6, 3)

    InsertText

    InsertText ( string pText, byte pOption=0 ) ,byte,proc    or    ( *cstring pText, byte pOption=0 ) ,byte,proc

    Description Example
    Example
    MyWord.InsertText ('Hello World')
    TempByte = MyWord.InsertText ('Hello World')

    InsertTextbox

    InsertTextbox ( string pText ) ,byte,proc

    Description

    Inserts a textbox into the current document. A Word textbox can be used to create complex layouts, and position blocks of text anywhere on the document.

    Before calling this method, you need to set up several properties, as shown in the example code above. This lets you set up exactly how the TextBox will be drawn when you finally call the InsertTextbox method.

    The self.Textbox.TextOrientation property can be set to any equate listed here.
    The self.Textbox.ZOrder property can be set to any equate listed here.
    Return Values

    Returns true (1) if no problems were experienced.

    Example

    Example
    MyWord.Textbox.BoxAlignment = oiw:ShapeCenter
    MyWord.Textbox.YPos = 153
    MyWord.Textbox.Width = 200
    MyWord.Textbox.Height = 50
    MyWord.Textbox.ShowBorders = true
    MyWord.Textbox.BorderColor = color:yellow
    MyWord.Textbox.BorderWidth = '5'
    MyWord.Textbox.TextFont = 'Arial'
    MyWord.Textbox.TextSize = 20
    MyWord.Textbox.TextColor = color:red
    MyWord.Textbox.TextOrientation = oiw:TextOrientationHorizontal
    MyWord.Textbox.TextAlignment = oiw:AlignParagraphRight
    MyWord.Textbox.ZOrder = oiw:SendBehindText
    MyWord.Textbox.MoveWithText = false
    ! once the properties are set we can now call the method...
    MyWord.InsertTextbox ('Hello world!')

    Italic

    Italic ( byte pOption ) ,byte,proc

    Description Example
    Example
    MyWord.Italic (oiw:ItalicToggle)
    TempByte = MyWord.Italic (oiw:ItalicToggle)

    Kill

    Kill ( byte UnloadCOM=1 ) ,byte,proc

    Description Example
    Example
    MyWord.Kill()
    TempByte = MyWord.Kill()

    LinesToPoints

    LinesToPoints ( string pLines ) ,string

    Description Example
    Example
    loc:Points = MyWord.LinesToPoints(5)
    MyWord.Update(oiw:PageLeftMargin, MyWord.LinesToPoints(5))

    MailMergeEmail

    MailMergeEmail(string pAddressField,<string pSubject>,long pHighlightMergeFields=0,long pMailFormat=0),long,proc

    Description Parameters
    Parameters
    pAddressFieldThe label of the datasource field that contains the EmailAddress
    pSubject The subject to use in the email subject (cannot vary for each email)
    pHighlightMergeFields Set if you want to highlight the Merge Fields
    pMailFormat Set if you want the format to be HTML, or 0 for plain text (by default).
    Example
    Example
    MyWord.MailMergeEmail('Email_Address','Test HTML')
    See also Using Mail Merge

    MailMergePrint

    MailMergePrint(<string pReserved>,long pHighlightMergeFields=0),long,proc

    Description Parameters
    Parameters
    pReservedReserved for future use.
    pHighlightMergeFields Set if you want to highlight the Merge Fields in the printed documents.
    Example
    Example
    MyWord.MailMergeEmail('')
    See also Using Mail Merge

    MailMergeInsertField

    MailMergeInsertField(string pFieldName,long pPosition=0),long,proc

    Description Parameters
    Parameters
    pFieldNameThe label of the datasource field that must be inserted into the document.
    pPosition If not zero, performs a selection to place the field in the document.
    Example
    Example
    MyWord.MailMergeInsertField('First_Name')
    See also Using Mail Merge

    MailMergeRun (obsolete - use MailMergeEmail)

    MailMergeRun ( ) ,byte,proc

    Description Example
    Example
    MyWord.MailMergeRun()
    TempByte = MyWord.MailMergeRun()
    See also Using Mail Merge

    MailMergeSetDataSource

    MailMergeSetDataSource(string DataSourceName,<string pReservedForLaterUse>,<string pReservedForLaterUse2>),byte,proc

    Description Example
    Example
    MyWord.MailMergeSetDataSource ( (longpath() & '\Addresses.csv'))
    See also Using Mail Merge

    MillimetersToPoints

    MillimetersToPoints ( string pMillimeters ) ,string

    Description Example
    Example
    loc:Points = MyWord.MillimetersToPoints(10)
    MyWord.Update(oiw:PageLeftMargin, MyWord.MillimetersToPoints(1.10))

    MoveDown

    MoveDown ( byte pUnit=oiw:UnitLine, long pCount=1, byte pExtend=oiw:Move ) ,byte,proc

    Description Example
    Example
    MyWord.MoveDown() ! move down one line

    MoveLeft

    MoveLeft ( byte pUnit=oiw:UnitCharacter, long pCount=1, byte pExtend=oiw:Move ) ,byte,proc

    Description Example
    Example
    MyWord.MoveLeft() ! move left one character

    MoveRight

    MoveRight ( byte pUnit=oiw:UnitCharacter, long pCount=1, byte pExtend=oiw:Move ) ,byte,proc

    Description Example
    Example
    MyWord.MoveRight() ! move right one character

    MoveUp

    MoveUp ( byte pUnit=oiw:UnitLine, long pCount=1, byte pExtend=oiw:Move ) ,byte,proc

    Description Example
    Example
    MyWord.MoveUp() ! move up one line

    NewDoc

    NewDoc ( <string TemplateName> ) ,byte,proc

    Description Example

    Example
    MyWord.NewDoc()
    TempByte = MyWord.NewDoc()
    MyWord.NewDoc ('MyTemplate.dot') ! assumes system default template directory
    MyWord.NewDoc (longpath() & '/templates/MyTemplate.dot')

    NextLine

    NextLine (  ) ,byte,proc

    Description Example
    Example
    MyWord.NextLine()
    TempByte = MyWord.NextLine()

    OpenDoc

    OpenDoc ( string pFileName, byte pReadOnly=false, byte pAddToRecentFiles=false, <string pPassword> ) ,byte,proc

    Description Example
    Example
    MyWord.OpenDoc('c:\test.doc')
    TempByte = MyWord.OpenDoc('c:\test.doc')

    OpenFooter

    OpenFooter ( ) ,byte,proc

    Description Example
    Example
    MyWord.OpenFooter()

    OpenHeader

    OpenHeader ( ) ,byte,proc

    Description Example
    Example
    MyWord.OpenHeader()

    PageSetup

    PageSetup (string pSetting, string pValue) ,byte,proc

    Description

    Allows the Page Setup attributes to be set for the current document (such as left margin, bottom margin, and paper size). Sizes are passed in points unless otherwise specified (see the notes below for the methods provided to convert units). For values than can be either True or False oi:True (-1) or oi:False(0) must be passed. Passing Clarion style Boolean values will result in incorrect behaviour.

    Parameters

    Parameter Description
    string pSettingA string specifying the settings to modify. Can be one of the following values:
    NameDescription
    'BookFoldPrinting'oi:True for Microsoft Word to print a document in a series of booklets so the printed pages can be folded and read as a book. Must be oi:True or oi:False.
    'BookFoldPrintingSheets'A Long which represents the number of pages for each booklet.
    'BookFoldRevPrinting'oi:True for Microsoft Word to reverse the printing order for book fold printing of bidirectional or Asian language documents. Must be oi:True or oi:False.
    'BottomMargin'The distance (in points) between the bottom edge of the page and the bottom boundary of the body text.
    'CharsLine'The number of characters per line in the document grid.
    'DifferentFirstPageHeaderFooter'True if a different header or footer is used on the first page. Can be oi:True or oi:False.
    'FirstPageTray'The paper tray to use for the first page of a document or section. May be one of the following values:
    oiw:PrinterAutomaticSheetFeed   equate(7)
    oiw:PrinterDefaultBin           equate(0)
    oiw:PrinterEnvelopeFeed         equate(5)
    oiw:PrinterFormSource           equate(15)
    oiw:PrinterLargeCapacityBin     equate(11)
    oiw:PrinterLargeFormatBin       equate(10)
    oiw:PrinterLowerBin             equate(2)
    oiw:PrinterManualEnvelopeFeed   equate(6)
    oiw:PrinterManualFeed           equate(4)
    oiw:PrinterMiddleBin            equate(3)
    oiw:PrinterOnlyBin              equate(1)
    oiw:PrinterPaperCassette        equate(14)
    oiw:PrinterSmallFormatBin       equate(9)
    oiw:PrinterTractorFeed          equate(8)
    oiw:PrinterUpperBin             equate(1)
    'FooterDistance'Distance (in points) between the footer and the bottom of the page.
    'Gutter'The amount (in points) of extra margin space added to each page in a document or section for binding.
    'GutterPos'Which side the gutter appears in a document. Must be one of the following:
    oiw:GutterPosLeft    equate(0)
    oiw:GutterPosRight   equate(2)
    oiw:GutterPosTop     equate(1)
    'GutterStyle'Qhether Microsoft Word uses gutters for the current document based on a right-to-left language or a left-to-right language:
    oiw:GutterStyleBidi  equate(2)
    oiw:GutterStyleLatin equate(-10)
    'HeaderDistance'The distance (in points) between the header and the top of the page.
    'LayoutMode'Returns or sets the layout mode for the current document:
    oiw:LayoutModeDefault   equate(0)
    oiw:LayoutModeGenko     equate(3)
    oiw:LayoutModeGrid      equate(1)
    oiw:LayoutModeLineGrid  equate(2)
    'LeftMargin'The distance (in points) between the left edge of the page and the left boundary of the body text.
    'LinesPage'The number of lines per page in the document grid.
    'MirrorMargins'True (oi:True) if the inside and outside margins of facing pages are the same width, otherwise oi:False
    'OddAndEvenPagesHeaderFooter'True (oi:True) if the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages, otherwise oi:False.
    'Orientation'Returns or sets the orientation of the page:
    oiw:OrientPortrait            equate(0)
    oiw:OrientLandscape           equate(1)
    'OtherPagesTray'The paper tray to be used for all but the first page of a document or section:
    		oiw:PrinterAutomaticSheetFeed   equate(7)
    		oiw:PrinterDefaultBin           equate(0)
    		oiw:PrinterEnvelopeFeed         equate(5)
    		oiw:PrinterFormSource           equate(15)
    		oiw:PrinterLargeCapacityBin     equate(11)
    		oiw:PrinterLargeFormatBin       equate(10)
    		oiw:PrinterLowerBin             equate(2)
    		oiw:PrinterManualEnvelopeFeed   equate(6)
    		oiw:PrinterManualFeed           equate(4)
    		oiw:PrinterMiddleBin            equate(3)
    		oiw:PrinterOnlyBin              equate(1)
    		oiw:PrinterPaperCassette        equate(14)
    		oiw:PrinterSmallFormatBin       equate(9)
    		oiw:PrinterTractorFeed          equate(8)
    		oiw:PrinterUpperBin             equate(1)
    'PageHeight' The height of the page in points.
    'PageWidth'The width of the page in points.
    'PaperSize'The paper size:
    oiw:Paper10x14            equate(0)
    oiw:Paper11x17            equate(1)
    oiw:PaperA3               equate(6)
    oiw:PaperA4               equate(7)
    oiw:PaperA4Small          equate(8)
    oiw:PaperA5               equate(9)
    oiw:PaperB4               equate(10)
    oiw:PaperB5               equate(11)
    oiw:PaperCSheet           equate(12)
    oiw:PaperCustom           equate(41)
    oiw:PaperDSheet           equate(13)
    oiw:PaperEnvelope10       equate(25)
    oiw:PaperEnvelope11       equate(26)
    oiw:PaperEnvelope12       equate(27)
    oiw:PaperEnvelope14       equate(28)
    oiw:PaperEnvelope9        equate(24)
    oiw:PaperEnvelopeB4       equate(29)
    oiw:PaperEnvelopeB5       equate(30)
    oiw:PaperEnvelopeB6       equate(31)
    oiw:PaperEnvelopeC3       equate(32)
    oiw:PaperEnvelopeC4       equate(33)
    oiw:PaperEnvelopeC5       equate(34)
    oiw:PaperEnvelopeC6       equate(35)
    oiw:PaperEnvelopeC65      equate(36)
    oiw:PaperEnvelopeDL       equate(37)
    oiw:PaperEnvelopeItaly    equate(38)
    oiw:PaperEnvelopeMonarch  equate(39)
    oiw:PaperEnvelopePersonal equate(40)
    oiw:PaperESheet           equate(14)
    oiw:PaperExecutive        equate(5)
    oiw:PaperFanfoldLegalGerman equate(15)
    oiw:PaperFanfoldStdGerman equate(16)
    oiw:PaperFanfoldUS        equate(17)
    oiw:PaperFolio            equate(18)
    oiw:PaperLedger           equate(19)
    oiw:PaperLegal            equate(4)
    oiw:PaperLetter           equate(2)
    oiw:PaperLetterSmall      equate(3)
    oiw:PaperNote             equate(20)
    oiw:PaperQuarto           equate(21)
    oiw:PaperStatement        equate(22)
    oiw:PaperTabloid          equate(23)
    'RightMargin'The distance (in points) between the right edge of the page and the right boundary of the body text.
    'SectionDirection'The reading order and alignment for the specified sections:
    oiw:SectionDirectionLtr   equate(1)
    oiw:SectionDirectionRtl   equate(0)
    'SectionStart'The type of section break for the specified object.
    oiw:SectionContinuous   equate(0)
    oiw:SectionEvenPage     equate(3)
    oiw:SectionNewColumn    equate(1)
    oiw:SectionNewPage      equate(2)
    oiw:SectionOddPage      equate(4)
    'SuppressEndnotes'If oi:True endnotes are printed at the end of the next section that doesn't suppress endnotes. Must be oi:True or oi:False
    'TopMargin'Returns or sets the distance (in points) between the top edge of the page and the top boundary of the body text.
    'TwoPagesOnOne'oi:True if Microsoft Word prints the specified document two pages per sheet. Must be oi:True or oi:False
    'VerticalAlignment'The vertical alignment of text on each page in a document or section:
    oiw:AlignVerticalBottom  equate(3)
    oiw:AlignVerticalCenter  equate(1)
    oiw:AlignVerticalJustify equate(2)
    oiw:AlignVerticalTop     equate(0)

    Parameter Description
    string pValueThe value to set the passed setting to. See the Settings descriptions above for valid values for each setting.
    Returns

    True (1) if successful, or False (0) for failure. The ErrorTrap method will be called with error information in the event of a failure.

    Notes

    Important: For values than can be either True or False, oi:True (-1) or oi:False (0)must be passed.

    Word uses Points to specify sizes, and OfficeInside provides methods to convert various units to points (and vice versa). See:
    CentimetersToPointsConvert a number from Centimeters to Points
    InchesToPointsConverts a number from inches to points
    LinesToPointsReturns the height of the passed number of lines in the document in points
    MillimetersToPointsConverts from millimeters info points
    PicasToPointsConverts from Picas to Points
    PixelsToPointsConverts from Pixels to Points
    PointsToCentimetersConverts from Points to Centimeters
    PointsToInchesConverts from Points to Inches
    PointsToLinesConverts from Points to Lines
    PointsToMillimetersConverts from Points to Millimeters
    PointsToPicasConverts from Points to Picas
    PointsToPixelsConverts from Points to Pixels

    Paste

    Paste ( ) ,byte,proc

    Description Example
    Example
    MyWord.Paste()
    TempByte = MyWord.Paste()

    PicasToPoints

    PicasToPoints ( string pPicas ) ,string

    Description Example
    Example
    loc:Points = MyWord.PicasToPoints(8)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PicasToPoints(8))

    PixelsToPoints

    PixelsToPoints ( string pPixels, byte pVertical=false ) ,string

    Description Example
    Example
    loc:Points = MyWord.PixelsToPoints(15)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PixelsToPoints(15))

    PointsToCentimeters

    PointsToCentimeters ( string pPoints ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToCentimeters(6)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToCentimeters(6))

    PointsToInches

    PointsToInches ( string pPoints ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToInches(14)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToInches(14))

    PointsToLines

    PointsToLines ( string pPoints ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToLines(8)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToLines(8))

    PointsToMillimeters

    PointsToMillimeters ( string pPoints ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToMillimeters(14)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToMillimeters(14))

    PointsToPicas

    PointsToPicas ( string pPoints ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToPicas(12)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToPicas(12))

    PointsToPixels

    PointsToPixels ( string pPoints, pVertical=false ) ,string

    Description Example
    Example
    loc:Points = MyWord.PointsToPixels(13)
    MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToPixels(13))

    PrintMe

    PrintMe     (<string pPages>, byte pRange=oiw:PrintAllDocument, long pCopies=1, byte pPageType=oiw:PrintAllPages, byte pBackground=false, <string pPrinterName>) ,byte,proc

    Description

    Prints the currently loaded document. This method has been replaced by the PrintOut(), which expands the supported options and is currently in Beta (see below).

    Parameters
    Parameter Description
    The pPages parameter holds the page numbers / ranges to be printed. If you do not pass a value in this parameter, a value of "print everything" is implied, but not passed. (See "notes" below). Valid examples for this parameter include:
    • '5, 6, 12'
    • '3, 5, 8-15'
    The pRange parameter can be one of the following values:
    • oiw:PrintAllDocument (default)
    • oiw:PrintSelection
    • oiw:PrintCurrentPage
    • oiw:PrintFromTo (not supported, use pPages instead)
    • oiw:PrintRangeOfPages (see notes below)
    The pCopies parameter is not supported by this method, use PrintOut() instead.
    The pPageType parameter can be one of the following values:
    • oiw:PrintAllPages (default)
    • oiw:PrintOddPagesOnly
    • oiw:PrintEvenPagesOnly
    The pBackground parameter determines whether this method returns before or after the document has actually been sent to the printer. This is very useful. Passing this parameter as "true" (1) will make the method return faster (as it does not wait for confirmation that the document has been sent to the printer), but you need to consider the implications of this. One implication is that calling MyWord.Kill might cause MS Word to show the "Word is currently printing. Quitting Word will cancel all pending jobs" warning. Passing this parameter as "false" (0) guarantees that the document has been sent to the printer before the PrintMe method returns, solving the problem (at the cost of a slight delay when you call the method).
    The pPrinterName parameter can be used to specify a printer other than the default printer, for example: MyWord.PrintMe ('1',,,,,'PDF-XChange 3.0')
    Notes

    In order for the pPages parameter to work, pRange needs to be oiw:PrintRangeOfPages. If you pass a value in pPages, and also pass anything other than oiw:PrintRangeOfPages in pRange, we will simply ignore what you pass in pRange. We do this so that the following code will work, even though pRange is going to default to oiw:PrintAllDocument, which wouldn't ordinarily work:
    MyWord.PrintMe ( '3,4,7-8' )

    If you're wanting to print a document to a printer other than the system default printer, the "safest" way to do this seems to be it is done in the "Two Printers" example. Notes can be found in that example.

    Examples
    Example
    TempByte = MyWord.PrintMe ()
    MyWord.PrintMe ('2,4,5-8') ! oiw:PrintRangeOfPages implied (see "Notes")
    MyWord.PrintMe ('2,4', oiw:PrintRangeOfPages)
    MyWord.PrintMe ( ,oiw:PrintCurrentPage)
    MyWord.PrintMe ( ,oiw:PrintSelection)
    MyWord.PrintMe ( ,,,oiw:PrintOddPagesOnly)
    MyWord.PrintMe ( ,,2)
    MyWord.PrintMe ('1',,,,,'Lexmark 3200')

    PrintOut

    PrintOut (*oiwPrintProperties printSettings, string printerName)

    Description

    The PrintOut method expand on the simple PrintMe() method and exposes all the properties supports by Word. The oiwPrintProperties group type is provided to allow the setting to be easily set and passed.

    Parameters

    Parameter Description Example
    *oiwPrintProperties printSettings A oiwPrintProperties group that contains the settings to be used for printing. See below for a description of the group type and fields. This is a TYPE'd group and can be used to create your own PrintSettings groups as follows: myPrintSettings   group(oiwPrintProperties)
                      end
    string printName The name of the printer to use for printing. See the PrintOut example, which uses the oiUtil class to enumerate all printers on the system.
    Return Values

    Returns 1 for success and zero if the COM interface encountered an error.

    Data Types
    oiwPrintProperties Type Fields
    NameType Description
    background longSet to True to have the code to execute continue while Microsoft Word prints the document.
    pAppend longSet to True to append the specified document to the file name specified by the OutputFileName argument. False to overwrite the contents of OutputFileName.
    pRange longThe page range. Can be any oiw:PrintOutRange constant:
    oiw:PrintAllDocument equate(0)
    oiw:PrintSelection   equate(1)
    oiw:PrintCurrentPage equate(2)
    oiw:PrintFromTo      equate(3)
    oiw:PrintRangeOfPages equate(4)
    outputFileName cstring(256)If PrintToFile is True, this argument specifies the path and file name of the output file.
    pFrom longThe starting page number when Range is set to oiw:PrintFromTo.
    pTo longThe ending page number when Range is set to oiw:PrintFromTo.
    pItem longThe item to be printed. Can be any oiw:PrintOutItem constant:
    oiw:PrintDocumentContent equate(0)
    oiw:PrintProperties      equate(1)
    oiw:PrintMarkup          equate(2)
    oiw:PrintComments        equate(2)
    oiw:PrintStyles          equate(3)
    oiw:PrintAutoTextEntries equate(4)
    oiw:PrintKeyAssignments  equate(5)
    oiw:PrintEnvelope        equate(6)
    oiw:PrintDocumentWithMarkup equate(7)
    copies longThe number of copies to be printed.
    pages cstring(1024)The page numbers and page ranges to be printed, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10.
    pageType The type of pages to be printed. Can be any oiw:PrintOutPages constant:
    oiw:PrintAllPages      equate(0)
    oiw:PrintOddPagesOnly  equate(1)
    oiw:PrintEvenPagesOnly equate(2)
    printToFile True to send printer instructions to a file. Make sure to specify a file name with OutputFileName.
    collate When printing multiple copies of a document, True to print all pages of the document before printing the next copy.
    FileNameThe path and file name of the document to be printed. If this argument is omitted, Word prints the active document. (not tested)
    activePrinterMacGX Not supported on the Windows platform.
    manualDuplexPrint True to print a two-sided document on a printer without a duplex printing kit. If this argument is True, the PrintBackground and PrintReverse properties are ignored. This argument may not be available to you, depending on the language support that you’ve selected or installed.
    printZoomColumn The number of pages you want Word to fit horizontally on one page. Can be 1, 2, 3, or 4. Use with the PrintZoomRow argument to print multiple pages on a single sheet.
    printZoomRow The number of pages you want Word to fit vertically on one page. Can be 1, 2, or 4. Use with the PrintZoomColumn argument to print multiple pages on a single sheet.
    printZoomPaperWidthThe width to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).
    printZoomPaperHeightThe height to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).

    PrintPreview

    PrintPreview ( ) ,byte    or    ( byte pOption ) ,byte,proc

    Description
    Example
    Example
    TempByte = MyWord.PrintPreview ()
      ( TempByte will be 1 if on, 0 if not )


    MyWord.PrintPreview (1)  ! turn print preview on
    MyWord.PrintPreview (0)  ! turn print preview off
    MyWord.PrintPreview (2)  ! toggle print preview


    TempByte = MyWord.PrintPreview (1) ! turn print preview on
    ! TempByte will return 1 if passed, 0 if an error occurred

    Protect

    Protect  (long protectionType, string pPassword),long

    Description

    Enables document protection. This limits what changes may be made to the document unless document protection is turned off. If a password is specified then that password must be used to turn document protection off. Once you enabled document protection the same limits that apply to the end user also apply to other methods called. For example if you enabled document protection and set the document to Read Only, you will not be able to modify the document by calling any of the oiWord methods until oiWord.Unprotect is called to remove the protection.

    Parameters
    Parameter Description
    long protectionType Type of protection to enabled. Can be one of the following values:
    • oiw:AllowOnlyComments - Only comments can be added or edited
    • oiw:AllowOnlyFormFields - Only form fields may be have their values edited.
    • oiw:AllowOnlyReading - Document is read only, no changes may be made
    • oiw:AllowOnlyRevisions - Only revisions may be made
    • oiw:NoProtection - No protection (the same as calling Unprotect()).
    string pPassword The password used to protect the document. This password will be needed to remove the protection. A blank string may be specified, which means that the protection can be removed without setting any password.
    Return Values

    Returns 1 for success and zero for failure.

    Example

    Example
    MyWord1.Protect(oiw:AllowOnlyComments, 'capesoft')
    MyWord1.Protect(oiw:AllowOnlyFormFields, '
    capesoft')
    MyWord1.Protect(oiw:AllowOnlyReading, '
    capesoft')
    MyWord1.Protect(oiw:AllowOnlyRevisions, '
    capesoft')
    MyWord1.Unprotect('
    capesoft')

    Redo

    Redo ( ) ,byte,proc

    Description Example
    Example
    MyWord.Redo()
    TempByte = MyWord.Redo()

    ReplaceText

    ReplaceText (string pFindText, string pReplaceText, byte pReplaceAll=false), byte, proc

    Description

    Search and replace method, locates a string in the document and replaces it with the specified string. This method searches the currently loaded document for the text you pass as the pFindText parameter, and then replaces that text with the text which you pass as the pReplaceText parameter. The pReplaceAll parameter determines whether the first instance the word / text is replace, or whether all instances are replaced.

    Important: Word limits the size of the strings being replaced and the replacement text to 256 characters. There are two ways of replacing strings larger than 256 characters:
    1. If your replacement string contains more than 256 characters use the FindText method to find the string and the call the InsertText method to replace it with your own string. You can to replace all instances by looping and calling FindText and replacing each instance until the FindText method it fails (returns zero), indicating that the string no longer exists in the document.
    2. Simply put your LargeString on the clipboard and call the ReplaceText method with the pRelaceText set to '^c':
      MyWord.ReplaceText('LookFor', '^c', True)

      The 2-character string '^c' will be interpreted by Word as the Paste command. This also has the advantage of supporting inserting RTF formatting text into Word (the Paste command is the only way to insert RTF formatting text directly into a Word document)
    Note: Replacement text inherits the formatting of the text it replaces in the document. For example, if you replace the string "abc" with "xyz," occurrences of "abc" with bold formatting are replaced with the string "xyz" with bold formatting. This also applies to case, in that if you replace "acb" with "xyz" you will get "xyz", but if you replace "ABC" with "xyz" you will in fact get "XYZ". This is actually pretty useful once you understand how it works, in that you can lay out the same search string in a document, multiple times, and each string can have its own formatting (case, bold, underlined etc) which is preserved when you replace.

    Parameters

    Parameter Description
    string pFindTextThe text to find in the document. This will be replace by the pReplaceText string if it is found.
    string pReplaceTextThe text to replace the pFindText string with
    byte pReplaceAllAn optional parameter specifying that all instances of the pFindText string in the document should be replaced by the pReplaceTextString. The default is false (only replace the first occurrence). Setting this to true (1) will replace all occurrences.
    Return Values

    Returns true (1) if no problems were experienced (Note: A return value of true does not indicate that any text was actually replaced. In other words, if the text you are searching for is not found, the method can still return true).

    Example
    Example
    MyWord1.ReplaceText('Cape', 'Soft')       ! replace "Cape" with "Soft"
    MyWord1.ReplaceText('
    Cape', 'Soft', true) ! replace all occurrences
    MyWord1.ReplaceText(searchString, replaceString)
    ! pass variables that contain the strings

    RestoreSnapShotOfWindowPos

    RestoreSnapShotOfWindowPos ( ) ,byte,proc

    Description Example
    Example
    MyWord.RestoreSnapShotOfWindowPos ()

    RunMacro

    RunMacro (string pMacroName,<string pParameter1>,<string pParameter2>,<string pParameter3>,<string pParameter4>,<string pParameter5>,<string pParameter6>,<string pParameter7>,<string pParameter8>,<string pParameter9>,<string pParameter10>) ,byte,proc

    Description Example
    Example
    TempByte = MyWord.RunMacro('MyMacro')

    Save

    Save ( ) ,byte,proc

    Description Example
    Example
    MyWord.Save()
    TempByte = MyWord.Save()

    SaveAs

    SaveAs ( <string pFileName>, long pFileFormat=oiw:SaveFormatDocumentDefault, <string pOpenPassword>, <string pEditPassword> ) ,byte,proc

    Description

    Saves the current document. If the FileName parameter is passed as an empty string (''), or is omitted, then a normal Save will be done. The pFileFormat parameter can be one of the values (equates) listed below.

    Important:
    1. As a result of changes to the behaviour of Word 2007, using oiw:FormatDocument as the pFileFormat now implies the old DOC format. This changes the behaviour of existing code, and as a result if you specify the incorrect file extension (.docx), you may be left with a document that does not open in Word. The default value for the pFormat parameter has been changed to oiw:SaveFormatDocumentDefault. Because oiw:FormatDocumentDefault doesn't exist in older version of Word, OfficeInside will automatically detect the version of Word being used, and use the correct document format for that version (oiw:FormatDocument for Word 2003 and earlier and oiw:FormatDocumentDefault for Word 2007 and later).
    2. We recommend not specifying a file extension, unless you are certain of the format that the document will be in. Word will automatically append the correct file extension. The GetFileName() method can be called once the file is saved to get the resultant file name. Alternatively before calling SaveAs() the GetOfficeVersion() method can be called to get the version of Office, and the file format and extension then chosen appropriately.
    3. The old equates, such as oiw:SaveFormat_EncodedText should be considered deprecated.
    Parameters

    Parameter Description
    pFileNameThe name and path of the file to open. If no path is specified, then OfficeInside will prefix the file name with the current application path.
    pFileFormat Word 2007 and later changes the meaning of a number of equates. In these cases the new version of the equate is show in bold below and highlighted

    oiw:FormatDocument              equate(0) !   Microsoft Office Word format.
    oiw:FormatDocument97            equate(0) !   Microsoft Word 97 document format.
    oiw:FormatTemplate              equate(1) !   Word template format.
    oiw:FormatTemplate97            equate(1) !   Word 97 template format.
    oiw:FormatText                  equate(2) !   Microsoft Windows text format.
    oiw:FormatTextLineBreaks        equate(3) !   Windows text format with line breaks preserved.
    oiw:FormatDOSText               equate(4) !   Microsoft DOS text format.
    oiw:FormatDOSTextLineBreaks     equate(5) !   Microsoft DOS text with line breaks preserved.
    oiw:FormatRTF                   equate(6) !   Rich text format (RTF).
    oiw:FormatEncodedText           equate(7) !   Encoded text format.
    oiw:FormatUnicodeText           equate(7) !   Unicode text format.
    oiw:FormatHTML                  equate(8) !   Standard HTML format.
    oiw:FormatWebArchive            equate(9) !   Web archive format.
    
    Available in Word 2007 and later
    
    
    oiw:FormatFilteredHTML          equate(10) !  Filtered HTML format.
    oiw:FormatXML                   equate(11) !  Extensible Markup Language (XML) format.
    oiw:FormatDocumentDefault       equate(16) !  Default document(.docx for Word 2007 and up)
    oiw:FormatPDF                   equate(17) !  PDF format.
    oiw:FormatXMLDocument           equate(12) !  XML document format.
    oiw:FormatXMLDocumentMacroEnabled equate(13) !  XML document format with macros enabled.
    oiw:FormatXMLTemplate           equate(14) !  XML template format.
    oiw:FormatXMLTemplateMacroEnabled equate(15) !  XML template format with macros enabled.
    oiw:FormatXPS                   equate(18) ! XPS format.
    pOpenPasswordOptional parameter that specifies a password to be used to protect the document. If this is passed, then the document will required this password in order to be opened. Can be used in conjunction with the pEditPassword parameter.
    pEditPasswordOptional parameter that specifies a password that allows the document to be edited. If this is specified then the document can still be opened without the password, however changes cannot be saved to the same document (SaveAs can still be used to save to the a new document, but the original file is treated as Read-Only). Can be used in conjunction with the pOpenPassword parameter.
    Return Value

    Returns true (1) if no problems were experienced, and false (0) if an error occurs. In the event of an error occuring the ErrorTrap() method is called with additional information.

    Examples
    Example 1
    Use the default format, add default extension automatically In the current app path.
    if WordDoc.SaveAs('mydocument') 
        savedFileName = WordDoc.GetFileName() 
    ! Get the saved file name (with the extension)
    else
       
    ! Error - save failed
    end

    Example 2
    Get the version of Office installed, and pick a file name and extension based on the version. Functionally identical to the approach in example 1.
    officeVersion = WordDoc.GetOfficeVersion()
    if officeVersion < 12  ! Office 2003 or earlier
        WordDoc.SaveAs('Document.doc', oiw:FormatDocument)
    else
        WordDoc.SaveAs('Document.docx', oiw:FormatDocumentDefault)
    end

    Example 3
    Identical to calling Save(). Prompts the user for a file name if the file has not been saved already.
    if not WordDoc.SaveAs()
       
    Message('Saving the document failed')
    end

    Example 4
    Save with a password required to open the file
    WordDoc.SaveAs(LongPath () & '\PasswordedDoc', oiw:FormatDocumentDefault, 'openpassword')

    Example 5
    Save with a password required to open the file, and a password to edit the document
    WordDoc.SaveAs(LongPath () & '\PasswordedDoc', oiw:FormatDocumentDefault, ' openpassword', 'editpassword')

    RefreshScreen

    RefreshScreen ()

    Description

    Redraws the screen. This method is useful when screen updating (redrawing) has been turned off using the SetScreenUpdating() method. Turn screen updating off can provide a small performance improvement for batch inserts etc. It is only recommended in cases where the user does not have to see or interact with the document. The same method can be used with the oiExcel object to slightly improve performance. For Excel, a large performance increase can be achieved when doing bulk updates by using the SetCalculations method.

    Note: There have been some reports of this causing problems with documents that the user opens while this setting is enabled. Considering how small the performance benefit of this option is we suggest using it with caution and ensuring that RefreshScreen() is called periodically and that screen updating is re-enabled once your are done.

    Parameters

    None

    Return Value

    Returns 1 if the function succeeds, and zero for failure. If the function fails the ErrorTrap() method is called with information relating to the error.

    Example

    Example
    ! Turn off screen updating
    WordDoc.SetScreenUpdating(
    false)
    ! Write the required data to the document here...

    ! Manually update the screen
    WordDoc.RefreshScreen()

    SetBackground

    SetBackground ( long pColor=0, <string pFileName> ) ,byte,proc

    Description Example

    Example
    MyWord.SetBackground ( ) ! no fill
    MyWord.SetBackground (color:yellow) ! fill color
    MyWord.SetBackground ( , 'c:\images\logo.jpg') ! fill image

    SetFontColor

    SetFontColor ( long FontColor ) ,byte,proc

    Description Example

    Example
    MyWord.SetFontColor (COLOR:Green)
    TempByte = MyWord.SetFontColor (COLOR:Green)

    SetFontName

    SetFontName ( string FontName ) ,byte,proc

    Description Example
    Example
    MyWord.SetFontName ('Arial')
    TempByte = MyWord.SetFontName ('Arial')

    SetFontSize

    SetFontSize ( long FontSize ) ,byte,proc

    Description Example
    Example
    MyWord.SetFontSize(14)
    TempByte = MyWord.SetFontSize(18)

    SetPageView

    SetPageView ( byte pPageView ) ,byte,proc

    Description Example
    Example
    MyWord.SetPageView (oiw:NormalView)
    TempByte = MyWord.SetPageView (
    oiw:NormalView)

    SetParagraphFormatting

    SetParagraphFormatting ( long pOption, string pValue, <string pValue2> ) ,byte,proc

    Description Example
    Example
    MyWord.SetParagraphFormatting (oiw:SpacingBefore, 30)
    MyWord.SetParagraphFormatting (oiw:LeftIndentation, MyWord1.CentimetersToPoints(2))
    MyWord.SetParagraphFormatting (oiw:LineSpacing, oiw:LineSpaceSingle)
    MyWord.SetParagraphFormatting (oiw:LineSpacing, oiw:LineSpaceExactly, 18)

    SetScreenUpdating

    SetScreenUpdating (long updateScreen)

    Description

    This method allows screen updating (redrawing) to be turned off and on. Turn screen updating off can provide a small performance improvement for batch inserts etc. It is only recommended in cases where the user does not have to see or interact with the document. The same method can be used with the oiExcel object to slightly improve performance. For Excel, a large performance increase can be achieved when doing bulk updates by using the SetCalculations method.

    Parameters
    Parameter Description
    long updateScreenSet this to 1(true) to turn screen updating on, and to zero (false) to turn screen updating off.
    Return Value

    Returns 1 if the function succeeds, and zero for failure. If the function fails the ErrorTrap() method is called with information relating to the error.

    Example
    Example
    WordDoc.SetScreenUpdating(false)
    ! Write the required data to the document here...

    ! Turn screen updating back on
    WordDoc.SetScreenUpdating(true)

    SetSelection

    SetSelection ( long pSelectionStart=0, long pSelectionEnd=0 ) ,byte,proc

    Description Example

    Example
    MyWord.SetSelection () ! select everything
    MyWord.SetSelection (10, 30) ! select from pos 10 to pos 30

    OR:

    SetSelection     ( long pTableNumber=1, long pColumnNumber, long pRowNumber ) ,byte,proc

    Description Example
    Example
    MyWord.SetSelection (1, 3, 4)  ! select cell C4 in table 1
    MyWord.SetSelection (1, 0, 0)  ! select table 1
    MyWord.SetSelection (2, 3, 0)  ! select column 3 in table 2
    MyWord.SetSelection (3, 0, 5)  ! select row 5 in table 3

    SetStyle

    SetStyle (string pStyle) ,long,proc

    Description Example

    Example
    MyWord.SetSelection (10, 30) ! select from pos 10 to pos 30
    MyWord.SetStyle ('Heading 1') ! Set the selection to use the Heading 1 style.
    See also SetSelection

    ShowMessage

    ShowMessage ( string _pText, string _pCaption, string _pIcon, long _pID )

    Description

    There are times when it is helpful if Office Inside displays a message, such as if an Office Application cannot be loaded or a document which you try to open does not actually exist, or so on. Because we know how frustrating it can be to have 3rdParty tools displaying messages in your applications Office Inside has this method, called ShowMessage. The way it works is as follows: If Office Inside needs to show a message we call this method, rather than calling the Clarion Message() or Stop() function directly. Inside this method (in our DLL) we call the Clarion Message function.
    The reason we do this is to give you a way to control which messages are shown, and how they are shown. If you embed code into the ShowMessage method, before the parent call, then every time Office Inside wants to show a message it will first run your code, then call the message, giving you a chance to "tweak" this, as illustrated below:

    Example
    MyWord1.ShowMessage PROCEDURE (string _pText, string _pCaption, string _pIcon, long _pID)
      CODE


        case _pID
       
    of oiw:Msg_Error_StartingWord
          ! no custom code
       
    of oiw:Msg_Confirm_SpellCheckComplete
          message ('
    Well done! No spelling mistakes.')
          return
       
    of oiw:Msg_Error_SpellCheckFailed
         
    return
     
      end

        PARENT.ShowMessage(_pText, _pCaption, _pIcon, _pID) 
    Notes

    Every time Office Inside wants to show a message it will call this method, setting _pID to one of the equates listed here. In the code above my "custom" code (shown in red) tweaks which messages I actually allow Office Inside, and which I don't. If the message was to warn that MS Word could not be started (_pID = oiw:Msg_Error_StartingWord), then I do nothing, so Office Inside will show it's message as per default. If the message is to tell the user that the Spell Check is now complete and there were no problems, I've changed the default behavior by showing my own message here, then returning before the parent call so that Office Inside's message does not also show. If the message was to warn that an error occurred during the Spell Check, I have decided that the user should not see that message and simply return before the parent call, so no message will be shown whatsoever. If you are happy to let Office Inside show any messages (we are obviously careful about what messages we show) then there is no need to put any code into this embed point yourself. To change the icon shown in the Office Inside messages use the oi_ChangeDefaultShowMessageIcon funciton.

    ShowToolbar

    ShowToolbar (long pToolbar ) ,byte,proc

    Description Example

    Example
    MyWord.ShowToolbar (oiw:ToolbarStandard)

    SetPrinter

    SetPrinter(string printerName)

    Description

    Sets the printer for the current Word document. Also turns off the display of print dialogs by calling the SetAlerts method automatically. This functionality is provide by the PrintOut method, so it not typically called directly.

    Parameters

    Parameter Description
    string printerNameThe name of the printer. See the PrintOut example application for an example of listing the installed printers.
    Return Values

    Returns true for success and false for failure.

    Examples
    Example
    oiWord.SetPrinter(printerName)
    See Also

    PrintOut

    SetAlerts

    SetAlerts  (long alertLevel)

    Description

    Sets the alert level (whether Word displays dialogues). Called automatically when PrintOut is used to allow automation of printing.

    Parameters
    Parameter Description
    string alertLevelCan be one of the following levels: oiw:AlertsNone(0), oiw:AlertsMessageBox(-2),  or oiw:AlertsAll(-1).
    Return Values

    Returns true for success and false for failure.

    Examples
    Example
    oiWord.SetAlerts(oiw:AlertsNone)

    ScreenRefresh

    ScreenRefresh()

    Refreshes the screen when screen updating has been turned off using the SetScreenUpdating method. Turning off screen updating when the window is hidden or when doing bulk inserts can improve performance by a small amount. Not that you need to call SetScreenUpdating to turn updating back on before calling ScreenRefresh() to refresh the display.

    Parameters

    None

    Return Values

    None

    Examples
    Example
    oiWord.SetScreenUpdating(true)
    oiwWord.ScreenRefresh()
    See Also

    SetScreenUpdating

    SpellCheckString

    SpellCheckString (*string checkText, long silent=1, long htmlText=0), long, proc

    Description

    Note that the template provides spell checking, and these methods are the underlying code that is used. If you use the provided spell checking templates you do not need to implemented these methods yourself.

    Spell checks the passed string (checkText) and allows the user to correct the spelling, while providing suggestions (much like Word, Outlook Express etc. would).

    Office Inside provides a Utility Template to add a Spell Checking window to your application. This procedure (oiShowSpellingSuggestions) provides a user interface for spell checking. For each word that may be misspelled this procedure calls the SpellWord procedure, which is generated into the procedure that you have added spell checking to. You should call your oiShowSpellingSuggestions from the SpellWord procedure (copy the bold line below to before the parent call):

    oiWord.SpellWord Procedure (string pWord, *oiwWordsQ WordsQ, *long pCommand)
    CODE

        return(oiShowSpellingSuggestions(pWord, WordsQ, pCommand))    ! Copy this line

    If you are using the Spell Checking template this can be done automatically by the template.

    Parameters
    Parameter Description
    *string checkTextThe string to spell check. There should be sufficient room in this string for any corrections (the corrected text may be longer than the passed text).
    long silentDetermines if the procedure displays a "Spell Checking Done" message box when spell checking of the string is complete. The default value is 1, which would not display a message, set this to zero in order to display the message.
    long htmlTextIndicates that the passed text comes from HTML and may contain HTML escape codes (such as &nbsp;) and URL encoded characters (such as %A1). You cannot pass HTML to this method, you should pass HTML to the SpellCheckHTML method, this setting is only for specific characters that occur in HTML. The default value is zero. This setting would not typically be used unless you are replacing the SpellCheckHtmlmethod with a version of your own and are passing the text portions of the HTML, excluding any tags etc., to this method.
    Return Value

    The function returns 1 for success or zero if an error occurred.

    Example
    Example
    case Choice(?SheetMailEdit)
    of 1 orof 2              ! Spell Check HTML
        HtmlEditor.GetInfo()
    ! HtmlEditor is a FileExplorer HTML editor control
       
    if Len(HtmlEditor.html2Source) > Len(htmlSource)
            htmlSource = HtmlEditor.html2Source[1 :
    Len(htmlSource)]
       
    else
            htmlSource = HtmlEditor.html2Source
       
    end
        WordSpell.SpellCheckHtml(htmlSource)
        HtmlEditor.Update('
    Html2Source', Clip(htmlSource))
    of 3                     ! Spell Check Text
        WordSpell.SpellcheckString(textData)
       
    Display(?textData)
    end
    See Also

    SpellWord,
    SpellCheckString

    SpellCheckHtml

    SpellCheckHtml (*string checkHtml, long silent=1)

    Description

    Note that the template provides spell checking, and these methods are the underlying code that is used. If you use the provided spell checking templates you do not need to implemented these methods yourself.

    Spell checks the passed string (checkHtml) and allows the user to correct the spelling, while providing suggestions (much like Word, Outlook Express etc. would). This function is identical to the SpellCheckString, except that it handles HTML content in the string. HTML tags, JavaScript, HTML escape codes and URL encoded characters are all ignored. This method provides spell checking support for File Explorer.

    Office Inside provides a Utility Template to add a Spell Checking window to your application. This procedure (oiShowSpellingSuggestions) provides a user interface for spell checking. For each word that may be misspelled this procedure calls the SpellWord procedure, which is generated into the procedure that you have added spell checking to. You should call your oiShowSpellingSuggestions from the SpellWord procedure (copy the bold line below to before the parent call):

    oiWord.SpellWord PROCEDURE (string pWord, *oiwWordsQ WordsQ, *long pCommand)
      CODE                                                                      
        return(oiShowSpellingSuggestions(pWord, WordsQ, pCommand))   ! Copy this line

    If you are using the Spell Checking template this can be done automatically by the template.


    Parameters

    Parameter Description
    *string checkHtmlThe string to spell check. There should be sufficient room in this string for any corrections (the corrected text may be longer than the passed text). This string contains the contents of an HTML file. For checking text rather than HTML call the SpellCheckString method.
    long silentDetermines if the procedure displays a "Spell Checking Done" message box when spell checking of the string is complete. The default value is 1, which would not display a message, set this to zero in order to display the message.
    Return Value

    The function returns 1 for success or zero if an error occurred.

    Example
    Example
    case Choice(?SheetMailEdit)
    of 1 orof 2                ! Spell Check HTML
        HtmlEditor.GetInfo()  
    ! HtmlEditor is a FileExplorer HTML editor control
       
    if Len(HtmlEditor.html2Source) > Len(htmlSource)
           htmlSource = HtmlEditor.html2Source[1 :
    Len(htmlSource)]
       
    else
           
    htmlSource = HtmlEditor.html2Source
       
    end
        WordSpell.SpellCheckHtml(htmlSource)
        HtmlEditor.Update('Html2Source',
    Clip(htmlSource))
    of 3                       ! Spell Check Text
        WordSpell.SpellcheckString(textData)
       
    Display(?textData)
    end
    See Also

    SpellWord, SpellCheckHtml

    SpellWord

    SpellWord (string pWord, *oiwWordsQ WordsQ, *long pCommand)

    Description

    This virtual method is called for each word that may be incorrect when CheckSpelling is called. This method provides a place for embed code to be added to display a spell checking user interface.

     If you are using the Spell Checking template this can be done automatically by the template.

    oiWord.SpellWord PROCEDURE (string pWord, *oiwWordsQ WordsQ, *long pCommand)   CODE                                                                      
        return(oiShowSpellingSuggestions(pWord, WordsQ, pCommand))   ! This is your procedure call

    We recommend using the oiShowSpellingSuggests method that the templates provide and modifying it according to your specific needs.

    Parameters
    Parameter Description
    *string pWordThe word being spell checking that may be incorrect
    oiwWordsQ WordsQA list of spelling suggests that Word has made to replace the current word
    Return Value

    The action that is to be performed, which can be one of the following values:
    oiw:Replace (0)
    oiw:Ignore (1)
    oiw:AddToDictionary (2)
    oiw:ReplaceAll (3)
    oiw:IgnoreAll (4)


    Example
    Example
    oiWord.SpellWord PROCEDURE (string pWord, *oiwWordsQ WordsQ, *long pCommand)
      CODE                                                                      
        return(oiShowSpellingSuggestions(pWord, WordsQ, pCommand))   ! This is your procedure call
    See Also

    SpellCheckString, SpellCheckHtml

    TableAutoFormat

    TableAutoFormat (longtableNumber, long tableStyle), long

    Description

    Formats the specified table using one of the styles provided by Word. These styles apply formatting to both the table and table contents. When new columns and rows are added the automatic formatting may not be applied to them, in which case the TableUpdateAutoFormatting method may be called to apply the same formatting to any new rows and columns.

    Parameters

    Parameter Description
    long tableNumberThe number of the table to format. Word numbers the first table in the document as 1, and each successive table increments that table number. Note that the tables are numbered in the order that they occur in, not in the order that they were added to the table, so if you have two tables and insert a new one between them the last table is numbered 3, rather than 2.
    long tableStyleAn equate that specifies one of the build-in styles provided by Word. May be one of the following values:
    • oiw:TableFormatNone
    • oiw:TableFormatSimple1
    • oiw:TableFormatSimple2
    • oiw:TableFormatSimple3
    • oiw:TableFormatClassic1
    • oiw:TableFormatClassic2
    • oiw:TableFormatClassic3
    • oiw:TableFormatClassic4
    • oiw:TableFormatColorful1
    • oiw:TableFormatColorful2
    • oiw:TableFormatColorful3
    • oiw:TableFormatColumns1
    • oiw:TableFormatColumns2
    • oiw:TableFormatColumns3
    • oiw:TableFormatColumns4
    • oiw:TableFormatColumns5
    • oiw:TableFormatContemporary
    • oiw:TableFormatElegant
    • oiw:TableFormatGrid1
    • oiw:TableFormatGrid2
    • oiw:TableFormatGrid3
    • oiw:TableFormatGrid4
    • oiw:TableFormatGrid5
    • oiw:TableFormatGrid6
    • oiw:TableFormatGrid7
    • oiw:TableFormatGrid8
    • oiw:TableFormatList1
    • oiw:TableFormatList2
    • oiw:TableFormatList3
    • oiw:TableFormatList4
    • oiw:TableFormatList5
    • oiw:TableFormatList6
    • oiw:TableFormatList7
    • oiw:TableFormatList8
    • oiw:TableFormat3DEffects1
    • oiw:TableFormat3DEffects2
    • oiw:TableFormat3DEffects3
    • oiw:TableFormatProfessional
    • oiw:TableFormatSubtle1
    • oiw:TableFormatSubtle2
    • oiw:TableFormatWeb1
    • oiw:TableFormatWeb2
    • oiw:TableFormatWeb3
    Return Values

    Returns 1 if successful and zero if it fails. In case of an error the ErrorTrap method will be called with the error description.

    Example
    Example
    oiWord.TableAutoFormat(1, oiw:TableFormatProfessional)
    See Also

    TableUpdateAutoFormat

    ShowToolbar

    ShowToolbar ( long pToolbar ) ,byte,proc

    Description Example
    Example
    MyWord.ShowToolbar (oiw:ToolbarStandard)
    TempByte = MyWord.ShowToolbar (oiw:ToolbarStandard)

    TableCountColumns

    TableCountColumns ( long TableNumber=1 ) ,long

    Description Example
    Example
    TempLong = MyWord.TableCountColumns ()  ! Table 1
    TempLong = MyWord.TableCountColumns (3)  ! Table 3

    TableCountRows

    TableCountRows ( long TableNumber=1 ) ,long

    Description Example
    Example
    TempLong = MyWord.TableCountRows ()  ! Table 1
    TempLong = MyWord.TableCountRows (3)  ! Table 3

    TableGetCellBackgroundColor

    TableGetCellBackgroundColor ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,long

    Description Example
    Example
    TempLong = MyWord.TableGetCellBackgroundColor (1, 3, 4)  ! table 1, cell C4

    TableGetCellForegroundColor

    TableGetCellForegroundColor ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,long

    Description Example
    Example
    TempLong = MyWord.TableGetCellForegroundColor (1, 3, 4)  ! table 1, cell C4

    TableGetCellTexture

    TableGetCellTexture ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,long

    Description Example
    Example
    TempLong = MyWord.TableGetCellTexture (1, 3, 4)  ! table 1, cell C4

    TableGetColumnWidth

    TableGetColumnWidth ( long TableNumber=1, long ColumnNumber ) ,long

    Description Example
    Example
    TempLong = MyWord.TableGetColumnWidth (1, 3)  ! table1, column3

    TableGetInsideBordersLineStyle

    TableGetInsideBordersLineStyle ( long TableNumber=1 ) ,byte

    Description Example
    Example
    TempByte = MyWord.TableGetInsideBordersLineStyle (3) ! table 3

    TableGetOutsideBordersLineStyle

    TableGetOutsideBordersLineStyle ( long TableNumber=1 ) ,byte

    Description Example
    Example
    TempByte = MyWord.TableGetOutsideBordersLineStyle (3) ! table 3

    TableInsertRowAtEnd

    TableInsertRowAtEnd ( long TableNumber=1 ) ,byte,proc

    Description Example
    Example
    MyWord.TableInsertRowAtEnd ()  ! table 1
    TempByte = MyWord.TableInsertRowAtEnd (3)  ! table 3

    TableMergeSelectedCells

    TableMergeSelectedCells ( ) ,byte,proc

    Description Example
    Example
    ! Merge cells B2 and C2
    if MyWord.SetSelection (1, 2, 2) ! select cell B2 in table 1
      MyWord.MoveRight (oiw:UnitCharacter, 1, oiw:Extend) ! select the cell to the right also (C2)
      MyWord.TableMergeSelectedCells() ! merge the two cells
      MyWord.SetSelection (1, 1, 1) ! deselect (select A1)
    end

    TableSetCellAlignCenter

    TableSetCellAlignCenter ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellAlignCenter (1, 3, 4)
    TempByte = MyWord.TableSetCellAlignCenter (1, 3, 4)

    TableSetCellAlignJustify

    TableSetCellAlignJustify ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellAlignJustify (1, 3, 4)
    TempByte = MyWord.TableSetCellAlignJustift (1, 3, 4)

    TableSetCellAlignLeft

    TableSetCellAlignLeft ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellAlignLeft (1, 3, 4)
    TempByte = MyWord.TableSetCellAlignLeft (1, 3, 4)

    TableSetCellAlignRight

    TableSetCellAlignRight ( long TableNumber=1, long ColumnNumber, long RowNumber ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellAlignRight (1, 3, 4)
    TempByte = MyWord.TableSetCellAlignRight (1, 3, 4)

    TableSetCellBackgroundColor

    TableSetCellBackgroundColor ( long TableNumber=1, long ColumnNumber, long RowNumber, long pColor ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellBackgroundColor (1, 3, 4, color:red)
    TempByte = MyWord.TableSetCellBackgroundColor (1, 3, 4, color:red)

    TableSetCellBold

    TableSetCellBold ( long TableNumber=1, long ColumnNumber, long RowNumber, byte pBold=255 ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellBold (1, 3, 4, oiw:BoldOn)
    TempByte = MyWord.TableSetCellBold (1, 3, 4, oiw:BoldOn)

    TableSetCellFontColor

    TableSetCellFontColor ( long TableNumber=1, long ColumnNumber, long RowNumber, long FontColor ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellFontColor (1, 3, 4, color:Green)
    TempByte = MyWord.TableSetCellFontColor (1, 3, 4, color:Green)

    TableSetCellFontName

    TableSetCellFontName ( long TableNumber=1, long ColumnNumber, long RowNumber, string FontName ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellFontName (1, 3, 4, 'Arial')
    TempByte = MyWord.TableSetCellFontName (1, 3, 4, 'Arial')

    TableSetCellFontSize

    TableSetCellFontSize ( long TableNumber=1, long ColumnNumber, long RowNumber, long FontSize ) ,byte,proc

    Description Example
    Example
    MyWord.TableSetCellFontSize (1, 3, 4, 12)
    TempByte = MyWord.TableSetCellFontSize (1, 3, 4, 12)

    TableSetCellForegroundColor

    TableSetCellForegroundColor ( long TableNumber=1, long ColumnNumber, long RowNumber, long pColor ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetCellForegroundColor (1, 3, 4, color:red)
    TempByte = MyWord.TableSetCellForegroundColor (1, 3, 4, color:red)

    TableSetCellItalic

    TableSetCellItalic ( long TableNumber=1, long ColumnNumber, long RowNumber, byte pItalic=255 ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetCellItalic (1, 3, 4, oiw:ItalicOn)
    TempByte = MyWord.TableSetCellItalic (1, 3, 4, oiw:ItalicOn)

    TableSetCellTexture

    TableSetCellTexture ( long TableNumber=1, long ColumnNumber, long RowNumber, long pTexture ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetCellTexture (1, 3, 4, oiw:TextureCross)
    TempByte = MyWord.TableSetCellTexture (1, 3, 4, oiw:TextureCross)

    TableSetCellUnderline

    TableSetCellUnderline ( long TableNumber=1, long ColumnNumber, long RowNumber, byte LineStyle=255 ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetCellUnderline (1, 3, 4, oiw:UnderlineSingle)
    TempByte = MyWord.TableSetCellUnderline (1, 3, 4, oiw:UnderlineSingle)

    TableSetColumnWidth

    TableSetColumnWidth ( long TableNumber=1, long ColumnNumber, long ColumnWidth ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetColumnWidth (1, 3, 40)
    TempByte = MyWord.TableSetColumnWidth (1, 3, 40)

    TableSetInsideBordersLineStyle

    TableSetInsideBordersLineStyle ( long TableNumber=1, byte LineStyle ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetInsideBordersLineStyle (1, oiw:LineStyleDouble)
    TempByte = MyWord.TableSetInsideBordersLineStyle (1, oiw:LineStyleDouble)

    TableUpdateAutoFormat

    TableUpdateAutoFormat (long tableNumber), long

    Description

    The TableAutoFormat method formats the specified table using one of the styles provided by Word. These styles apply formatting to both the table and table contents. When new columns and rows are added the automatic formatting may not be applied to them, in which case the TableUpdateAutoFormatting method may be called to apply the same formatting to any new rows and columns.

    Parameters
    Parameter Description
    long tableNumberThe number of the table to format. Word numbers the first table in the document as 1, and each successive table increments that table number. Note that the tables are numbered in the order that they occur in, not in the order that they were added to the table, so if you have two tables and insert a new one between them the last table is numbered 3, rather than 2.
    Return Values

    Returns 1 if successful and zero if it fails. In case of an error the ErrorTrap method will be called with the error description.

    Example
    Example
    oiWord.TableUpdateAutoFormat(1)
    See Also

    TableAutoFormat

    TableSetOutsideBordersLineStyle

    TableSetOutsideBordersLineStyle ( long TableNumber=1, byte LineStyle ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableSetOutsideBordersLineStyle (1, oiw:LineStyleDouble)
    TempByte = MyWord.TableSetOutsideBordersLineStyle (1, oiw:LineStyleDouble)

    TableWriteToCell

    TableWriteToCell ( long TableNumber=1, long ColumnNumber, long RowNumber, string pText ) ,byte,proc

    Description
    Example
    Example
    MyWord.TableWriteToCell (1, 3, 4, "Cell C4") ! table 1
    TempByte = MyWord.TableWriteToCell (3, 3, 4, "Cell C4") ! table 3

    TakeEvent

    TakeEvent ( string pEventString1, string pEventString2, long pEventNumber=0, byte pEventType=0, byte pEventStatus=0 )

    Description

    TakeSnapShotOfWindowPos

    TakeSnapShotOfWindowPos ( ) ,byte,proc

    Description
    Example
    Example
    MyWord.TakeSnapShotOfWindowPos ()

    Underline

    Underline ( byte LineStyle ) ,byte,proc

    Description
    Example
    Example
    MyWord.Underline (oiw:UnderlineDouble)
    TempByte = MyWord.Underline (oiw:UnderlineNone)

    Undo

    Undo ( ) ,byte,proc

    Description
    Example
    Example
    MyWord.Undo()
    TempByte = MyWord.Undo()

    Unprotect

    Unprotect  (string pPassword), long

    Description

    Removes document protection. Protection limits what changes may be made to the document unless document protection is turned off. If a password is specified then that password must be used to turn document protection off. Once you enabled document protection the same limits that apply to the end user also apply to other methods called. For example if you enabled document protection (by calling oiWord.Protect()) and set the document to Read Only, you will not be able to modify the document by calling any of the oiWord methods until oiWord. Unprotect() is called to remove the protection.

    Parameters

    Parameter Description
    string pPasswordThe password that was used to protect the document. This password will be needed to remove the protection. A blank string may be specified, if the protection was added with a blank password.
    Return Values

    Returns 1 for success and zero for failure.

    Example
    Example
    MyWord1.Unprotect('capesoft')   ! Unprotect a password protected document
    MyWord1.Unprotect('')          
    ! Unprotect where a blank password was used

    Update

    Update (byte pOption, string pValue), long, proc

    Description

    This is a wrapper method which can update one of several "properties" or "settings", depending on the parameters which you pass.
    Example
    Example
    MyWord.Update (oiw:StatusBar, 'Hello World')
    TempByte = MyWord.Update (oiw:WindowState, oiw:MinimizeWindow)

    Properties of the oiWord class

    This section lists the properties of the Excel class and their use. This section is a work in Progress and will be fleshed out in the next few releases.
    oiWord Class Properties
    dontCloseOnKill Leaves Word open when the Kill method is called (common to all classes) (set after Init, but before Kill)
    ActiveDocumentA handle to the ActiveDocument oiObject.
    ActiveWindow A handle to the ActiveWindow oiObject.
    SelectionA handle to the Selection oiObject.
    TablesA handle to the Tables oiObject.
    RangeA handle to the Range oiObject.
    ParagraphsA handle to the Paragraphs oiObject.
    Example
    Example
    ! Clean up the object and COM interface, but leave Word open:
    myWord.dontCloseOnKill = 1
    myWord.Kill()

    The oiWord Class - Equates

    "Update / GetInfo" Equates    ( used in the GetInfo and Update methods )
    Equate:  GetInfo?Description...   ( TO DO )
    oiw:ActivePrinter
    oiw:ApplicationVersion
    oiw:Build
    oiw:CapsLockOn
    oiw:ComputerType
    oiw:Country
    oiw:DisplayRecentFiles
    oiw:DisplayScrollBars
    oiw:FreeDiskSpace
    oiw:Height the height of the MS Word application window
    oiw:LanguageDesignation
    oiw:Left
    oiw:MailMerge
    oiw:MapiAvailable
    oiw:MouseAvailable
    oiw:NumLockOn
    oiw:OS
    oioiw:PageFit
    oiw:PageLeftMargin the current document's left margin
    oiw:PageRightMargin the current document's right margin
    oiw:PageTopMargin
    oiw:PageBottomMargin
    oiw:PageOrientation
    oiw:PageWidth the actual width of the current document (incl margins)
    oiw:Path
    oiw:ProcessorType
    oiw:StartupPath
    oiw:StatusBar
    oiw:Top the y coordinate of the MS Word application window
    oiw:UsableHeight
    oiw:UsableWidth
    oiw:UserAddress
    oiw:UserInitials
    oiw:UserName
    oiw:Visible
    oiw:Width the width of the MS Word application window
    oiw:WindowState
    oiw:Version
    oiw:Zoom
    oiw:FullScreenMode
    oiw:RulerVisible
    oiw:ApplicationVisible


    "Goto" Equates     ( used in the GotoItem method )This section of the documentation is deprecated. Please refer to the new GotoItem method documentation for a full list of equates and descriptions of each value and how they can be used.
    "LineStyle" Equates
    Used in the TableGetInsideBordersLineStyle, TableGetOutsideBordersLineStyle, TableSetInsideBordersLineStyle, TableSetOutsideBordersLineStyle methods
    oiw:LineStyleNone
    oiw:LineStyleSingle
    oiw:LineStyleDot
    oiw:LineStyleDashSmallGap
    oiw:LineStyleDashLargeGap
    oiw:LineStyleDashDot
    oiw:LineStyleDashDotDot
    oiw:LineStyleDouble
    oiw:LineStyleTriple
    oiw:LineStyleThinThickSmallGap
    oiw:LineStyleThickThinSmallGap
    oiw:LineStyleThinThickThinSmallGap
    oiw:LineStyleThinThickMedGap
    oiw:LineStyleThickThinMedGap
    oiw:LineStyleThinThickThinMedGap
    oiw:LineStyleThinThickLargeGap
    oiw:LineStyleThickThinLargeGap
    oiw:LineStyleThinThickThinLargeGap
    oiw:LineStyleSingleWavy
    oiw:LineStyleDoubleWavy
    oiw:LineStyleDashDotStroked
    oiw:LineStyleEmboss3D
    oiw:LineStyleEngrave3D
    oiw:LineStyleOutset
    oiw:LineStyleInset
    "Underline" Equates
    Used in the TableSetCellUnderline, Underline methods.

    See the reference titled MS Word Underline Styles for graphical examples of these styles.
    oiw:UnderlineNone
    oiw:UnderlineSingle
    oiw:UnderlineWords
    oiw:UnderlineDouble
    oiw:UnderlineDotted
    oiw:UnderlineThick
    oiw:UnderlineDash
    oiw:UnderlineDotDash
    oiw:UnderlineDotDotDash
    oiw:UnderlineWavy
    oiw:UnderlineWavyHeavy
    oiw:UnderlineDottedHeavy
    oiw:UnderlineDashHeavy
    oiw:UnderlineDotDashHeavy
    oiw:UnderlineDotDotDashHeavy
    oiw:UnderlineDashLong
    oiw:UnderlineDashLongHeavy
    oiw:UnderlineWavyDouble
    oiw:UnderlineToggle
    "Texture" Equates
    Used in the TableGetCellTexture, TableSetCellTexture methods )

    See the reference titled MS Word Textures for graphical examples of these equates.
    oiw:TextureNone
    oiw:Texture2Pt5Percent
    oiw:Texture5Percent
    oiw:Texture7Pt5Percent
    oiw:Texture10Percent
    oiw:Texture12Pt5Percent
    oiw:Texture15Percent
    oiw:Texture17Pt5Percent
    oiw:Texture20Percent
    oiw:Texture22Pt5Percent
    oiw:Texture25Percent
    oiw:Texture27Pt5Percent
    oiw:Texture30Percent
    oiw:Texture32Pt5Percent
    oiw:Texture35Percent
    oiw:Texture37Pt5Percent
    oiw:Texture40Percent
    oiw:Texture42Pt5Percent
    oiw:Texture45Percent
    oiw:Texture47Pt5Percent
    oiw:Texture50Percent
    oiw:Texture52Pt5Percent
    oiw:Texture55Percent
    oiw:Texture57Pt5Percent
    oiw:Texture60Percent
    oiw:Texture62Pt5Percent
    oiw:Texture65Percent
    oiw:Texture67Pt5Percent
    oiw:Texture70Percent
    oiw:Texture72Pt5Percent
    oiw:Texture75Percent
    oiw:Texture77Pt5Percent
    oiw:Texture80Percent
    oiw:Texture82Pt5Percent
    oiw:Texture85Percent
    oiw:Texture87Pt5Percent
    oiw:Texture90Percent
    oiw:Texture92Pt5Percent
    oiw:Texture95Percent
    oiw:Texture97Pt5Percent
    oiw:TextureSolid
    oiw:TextureDarkHorizontal
    oiw:TextureDarkVertical
    oiw:TextureDarkDiagonalDown
    oiw:TextureDarkDiagonalUp
    oiw:TextureDarkCross
    oiw:TextureDarkDiagonalCross
    oiw:TextureHorizontal
    oiw:TextureVertical
    oiw:TextureDiagonalDown
    oiw:TextureDiagonalUp
    oiw:TextureCross
    oiw:TextureDiagonalCross
    Toolbar Equates
    Used in the ShowToolbar and HideToolbar methods.
    oiw:ToolbarStandard
    oiw:ToolbarFormatting
    oiw:ToolbarTablesAndBorders
    oiw:ToolbarDatabase
    oiw:ToolbarDrawing
    oiw:ToolbarForms
    oiw:ToolbarFullScreen
    oiw:ToolbarEditPicture
    oiw:ToolbarVisualBasic
    oiw:ToolbarStopRecording
    oiw:ToolbarMailMerge
    oiw:ToolbarMasterDocument
    oiw:ToolbarMicrosoft
    oiw:ToolbarHeaderAndFooter
    oiw:ToolbarOutlining
    oiw:ToolbarPrintPreview
    oiw:ToolbarWordForWindows2Point0
    oiw:ToolbarReadMail
    oiw:ToolbarSendMail
    oiw:ToolbarExtendedFormatting
    oiw:ToolbarAutoText
    oiw:ToolbarWeb
    oiw:ToolbarWordArt
    oiw:Toolbar3DSettings
    oiw:ToolbarShadowSettings
    oiw:ToolbarPicture
    oiw:ToolbarDrawingCanvas
    oiw:ToolbarOrganizationChart
    oiw:ToolbarDiagram
    oiw:ToolbarReviewing
    oiw:ToolbarAutoSummarize
    oiw:ToolbarExitDesignMode
    oiw:ToolbarControlToolbox
    oiw:ToolbarTextBox
    oiw:ToolbarOutlookReadMail
    oiw:ToolbarOutlookSendMail
    oiw:ToolbarFunctionKeyDisplay
    oiw:ToolbarWebTools
    oiw:ToolbarWordCount
    oiw:ToolbarJapaneseGreetings
    oiw:ToolbarMenuBar
    oiw:ToolbarRefresh
    oiw:ToolbarFrames
    oiw:ToolbarTaskPane
    oiw:ToolbarDropCaps
    oiw:ToolbarEndnotes
    oiw:ToolbarFields
    oiw:ToolbarDisplayFields
    oiw:ToolbarFieldDisplayListNumbers
    oiw:ToolbarFormFields
    oiw:ToolbarFootnotes
    ! oiw:ToolbarFrames equate   !duplicate
    oiw:ToolbarHeadings
    oiw:ToolbarLinkedHeadings
    oiw:ToolbarScriptAnchorPopup
    oiw:ToolbarLists
    oiw:ToolbarInlinePicture
    oiw:ToolbarInlineCanvas
    oiw:ToolbarHorizontalLinePopup
    oiw:ToolbarTables
    oiw:ToolbarTableCells
    oiw:ToolbarTableHeadings
    oiw:ToolbarTableLists
    oiw:ToolbarTablePictures
    oiw:ToolbarTableText
    oiw:ToolbarWholeTable
    oiw:ToolbarLinkedTable
    oiw:ToolbarText
    oiw:ToolbarLinkedText
    oiw:ToolbarFontPopup
    oiw:ToolbarFontParagraph
    oiw:ToolbarFormatInspectorPopupInNormalMode
    oiw:ToolbarFormatInspectorPopupInCompareMode
    oiw:ToolbarSpelling
    oiw:ToolbarGrammar
    oiw:ToolbarGrammar2
    oiw:ToolbarFormatConsistency
    oiw:ToolbarBackgroundProofingStatusBar
    oiw:ToolbarTrackChanges
    oiw:ToolbarFrameProperties
    oiw:ToolbarHyperlinkContextMenu
    oiw:ToolbarAutoSignaturePopup
    oiw:ToolbarFieldAutoText
    oiw:ToolbarDocumentMap
    oiw:ToolbarShapes
    oiw:ToolbarCurve
    oiw:ToolbarCurveNode
    oiw:ToolbarCurveSegment
    oiw:ToolbarFloatingPicture
    oiw:ToolbarCanvasPopup
    oiw:ToolbarOLEObject
    oiw:ToolbarActiveXControl
    oiw:ToolbarWordArtContextMenu
    oiw:ToolbarRotateMode
    oiw:ToolbarComment
    oiw:ToolbarOrganizationChartPopup
    ! oiw:ToolbarDiagram ! duplicate
    oiw:ToolbarConnector
    oiw:ToolbarTrackChangesIndicator
    oiw:ToolbarChineseTranslation
    oiw:ToolbarAddressBlockPopup
    oiw:ToolbarGreetingLinePopup
    oiw:ToolbarInlineActiveXControl
    oiw:ToolbarAutoShapes
    oiw:ToolbarCallouts
    oiw:ToolbarFlowchart
    oiw:ToolbarBlockArrows
    oiw:ToolbarStarsAndBanners
    oiw:ToolbarLines
    oiw:ToolbarBasicShapes
    oiw:ToolbarConnectors
    oiw:ToolbarFillColor
    oiw:ToolbarInsertShape
    oiw:ToolbarLineColor
    oiw:ToolbarAlignOrDistribute
    oiw:ToolbarRotateOrFlip
    oiw:ToolbarOrder
    oiw:ToolbarNudge
    oiw:ToolbarBorders
    oiw:ToolbarFontColor
    oiw:ToolbarShadingColor
    oiw:ToolbarCellAlignment
    oiw:ToolbarTextWrapping
    oiw:ToolbarClipboard
    oiw:ToolbarEnvelope
    oiw:ToolbarSystem
    Callback Event Equates
    Used in the TakeEvent method.
    oiw:EventStartup
    oiw:EventQuit
    oiw:EventDocumentChange
    oiw:EventDocumentOpen
    oiw:EventDocumentBeforeClose
    oiw:EventDocumentBeforePrint
    oiw:EventDocumentBeforeSave
    oiw:EventNewDocument
    oiw:EventWindowActivate
    oiw:EventWindowDeactivate
    oiw:EventWindowSelectionChange
    oiw:EventWindowBeforeRightClick
    oiw:EventWindowBeforeDoubleClick
    SaveFormat Equates
    See the SaveAs method documentation for a full list of equates.
    Break-Type Equates
    ( used in the InsertBreak method )
    oiw:SectionBreakNextPage
    oiw:SectionBreakContinuous
    oiw:SectionBreakEvenPage
    oiw:SectionBreakOddPage
    oiw:LineBreak
    oiw:PageBreak
    oiw:ColumnBreak
    oiw:LineBreakClearLeft
    oiw:LineBreakClearRight
    oiw:TextWrappingBreak
    Text Orientation Equates
    ( used in the InsertTextbox method )
    oiw:TextOrientationMixed
    oiw:TextOrientationHorizontal
    oiw:TextOrientationUpward
    oiw:TextOrientationDownward
    oiw:TextOrientationVerticalFarEast
    oiw:TextOrientationVertical
    oiw:TextOrientationHorizontalRotatedFarEast
    Z-Order Equates
    ( used in the InsertTextbox method )
    oiw:BringToFront
    oiw:SendToBack
    oiw:BringForward
    oiw:SendBackward
    oiw:BringInFrontOfText
    oiw:SendBehindText
    ShowMessage Equates
    ( used in the ShowMessage method )
    oiw:Msg_Error_StartingWord
    oiw:Msg_Confirm_SpellCheckComplete
    oiw:Msg_Error_SpellCheckFailed

    About using "Mail Merge"

    Before implementing Office Inside's Mail Merge features, we would recommend that you familiarize yourself with the basics of using MS Word's Mail Merge functionality. The MS Word help files cover this topic extensively, but here's a starter to get you going ( although we would recommend spending some time in MS Word learning about Mail Merging before adding this feature into your apps ).

    In a nutshell, Mail Merging consists of reading data from a Data Source ( a file that contains the information to be merged into the Main Document ); then inserting data from the data source into the Merge Fields ( placeholders in your main document ) which you have created in your Main Document ( the document that contains the text / graphics / merge fields ).

    MS Word Underline styles

    Below is an example of each of the types of underlining that MS Word offers. See also the Underline method, and the Underline Equates.

    MS Word Textures

    Below is an example of the various textures used in methods such as SetCellTexture, as listed in the Texture Equates. These examples show the various textures, using a background color of yellow ( see SetCellBackgroundColor ) and a foreground color of red ( see SetCellForegroundColor).