|
|
|||
© 2008 by CapeSoft Software (Pty) Ltd www.capesoft.com |
|||
![]() |
Microsoft Word Functionality |
| Add_MSWord_Object | |||
| Summary | |||
| Procedure Extension Template Add an MS Word object to a procedure Optional |
|||
| 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. 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. |
|||
| How do I implement it? | |||
|
|||
|
What are my options? |
|||
|
General Tab: Object Name: This is the name of the Office Inside object that this template will create and implement. Typically this would default to 'MyWord1', but you can change it if you would prefer to call the object something else.
|
|||
| Word_SpellChecking | |||
| Summary | |||
| Extension Template Important for Clarion 5.5 users Important for Clarion 6 users |
|||
| What does it do? | |||
| This template adds
Spell Checking support to a window. Simply add it to a window procedure
and you will be able to press F7 (or which ever key you select) and the
currently selected field will be "spell-checked". |
|||
| Prerequisites | |||
|
|||
| How do I implement it? | |||
|
|||
|
What are my options? |
|||
|
Keycode to alert for: This is the key that Office Inside will watch for, which will invoke the Spell Checker. Typically this defaults to 'F7Key'.
|
|||
| C55 RTF Controls | |||
For Clarion 5.5 you need to populate the 'Office Inside Spell Check for C55 RTF' control template onto your window for each RTF control. You must have added a Word object to your procedure in order to use this control template.
You can optionally specify the maximum size for the spelling checking string (this defaults to 256K), and whether or not a message should be shown to the user when spell checking is complete (defaults to on) |
|||
| Clarion RTF Controls | |||
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. This has been added becuase in order to use spell checking on Clarion 6 RTF controls the RtfControlClass needs to have a line modified. If you have ticked this box to enable spell checking of Clarion 6 RTF controls, then open the rtfctl.inc file in your Clarion6\libsrc directory and change the lines that reads: CtlRTF SIGNED,PROTECTED to: CtlRTF SIGNED!,PROTECTED The PROTECTED attribute needs to be commented out in order to allow Office Inside to identify which control the object is associated with. |
|||
| oiWord Class Methods | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
AlignCenter
( ) ,byte,proc
|
| AlignJustify
( ) ,byte,proc MyWord.AlignJustify () TempByte = MyWord.AlignJustify ()
|
| AlignLeft
( ) ,byte,proc MyWord.AlignLeft () TempByte = MyWord.AlignLeft ()
|
| AlignRight
( ) ,byte,proc MyWord.AlignRight () TempByte = MyWord.AlignRight ()
|
| Bold
( byte pOption=oiw:BoldToggle ) ,byte,proc MyWord.Bold (oiw:BoldOn) TempByte = MyWord.Bold (oiw:BoldOn)
|
|
CentimetersToPoints
( string pCentimeters ) ,string loc:Points = MyWord.CentimetersToPoints(1.5) MyWord.Update(oiw:PageLeftMargin, MyWord.CentimetersToPoints(1.5))
|
| CheckGrammar
( *string pText ) ,byte TempByte = MyWord.CheckGrammar (StringVar)
|
| CheckSpelling
( string pText, byte pSilent ) ,byte,proc StringVar = 'This is spelld wrongg' TempByte = MyWord.CheckSpelling (StringVar) if MyWord.CheckSpelling (loc:Var1, false, false) = true
|
|
CheckSpelling_AddToIgnoredWords
( string pText ) ,byte,proc MyWord.CheckSpelling_AddToIgnoredWords ('CapeSoft')
|
|
CheckSpelling_IsWordIgnored
( string pText ) ,byte,proc if MyWord.CheckSpelling_IsWordIgnored ('CapeSoft') = true ...
|
| CloseDoc
( ) ,byte,proc MyWord.CloseDoc() TempByte = MyWord.CloseDoc()
|
| CloseFooter
( ) ,byte,proc MyWord.CloseFooter()
|
| CloseHeader
( ) ,byte,proc MyWord.CloseHeader()
|
| Copy
( ) ,byte,proc MyWord.Copy() TempByte = MyWord.Copy()
|
| CountCharacters
( ) ,long TempLong = MyWord.CountCharacters ()
|
| CountOpenDocs
( ) ,long TempLong = MyWord.CountOpenDocs()
|
| CountTables
( ) ,long TempLong = MyWord.CountTables ()
|
| Cut
( ) ,byte,proc MyWord.Cut() TempByte = MyWord.Cut()
|
| FindText
(string pText), long 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). Parameters 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 ! Find all instances of the
word 'Hello' and make them bold.
|
|
ErrorTrap
( string pErrorString, string pFunctionName ) MyWord1.ErrorTrap
PROCEDURE (string
pErrorString, string
pFunctionName)
|
| GetFontColor
( ) ,long TempLong = MyWord.GetFontColor()
|
| GetFontName
( ) ,string TempString = MyWord.GetFontName()
|
| GetFontNames
( ) ,byte,proc MyWord.GetFontNames ()
|
| GetFontSize
( ) ,long TempLong = MyWord.GetFontSize()
|
| GetInfo
( byte pOption ) ,string,proc TempString = MyWord.GetInfo (oiw:GetUserName)
|
|
GetNameOfDictionary
( ) ,string TempString = MyWord.GetNameOfDictionary()
|
| GetSelectionEnd
( ) ,long TempLong = MyWord.GetSelectionEnd()
|
| GetSelectionStart
( ) ,long TempLong = MyWord.GetSelectionStart()
|
| GetText
( byte pScope=oiw:GetText_All ) ,byte,proc if MyWord1.GetText (oiw:GetText_CurrentSelection) = true stop(MyWord1.TempCString) end
|
|
GotoEndOfDoc ( ), byte, proc Moves the cursor to the end of the current document. Return Values Returns true (1) if no problems were experienced. Examples MyWord.GotoEndOfDoc() See Also
|
|
GotoItem
(long pItem, <long pDirection>,
<long pName>, <long pCount>),
long, proc 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 long pItem: The item to go to. Can be one of the GoTo equates:
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:
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 ! Go to the last line in the
document
|
| HideToolbar
( long pToolbar ) ,byte,proc MyWord.HideToolbar (oiw:ToolbarStandard) TempByte = MyWord.HideToolbar (oiw:ToolbarStandard)
|
|
InchesToPoints
( string pInches ) ,string loc:Points = MyWord.InchesToPoints(1.6875) MyWord.Update(oiw:PageLeftMargin, MyWord.InchesToPoints(1.6875))
|
| Init
( byte StartVisible=1, byte EnableEvents=1 ) ,byte,proc MyWord.Init() TempByte = MyWord.Init()
|
| InsertBreak
( long pBreakType=oiw:PageBreak ) ,byte,proc MyWord.InsertBreak () MyWord.InsertBreak (oiw:PageBreak) MyWord.InsertBreak (oiw:TextWrappingBreak)
|
| InsertPicture
( string FileName ) ,byte,proc MyWord.InsertPicture ('c:\mypic.bmp') TempByte = MyWord.InsertPicture ('c:\mypic.bmp')
|
| InsertTable
( long NumColumns, long NumRows ) ,long,proc MyWord.InsertTable (6, 3) TempByte = MyWord.InsertTable (6, 3)
|
| InsertText
( string pText, byte pOption=0 ) ,byte,proc or
( *cstring pText, byte pOption=0 ) ,byte,proc MyWord.InsertText ('Hello World') TempByte = MyWord.InsertText ('Hello World')
|
InsertTextbox ( string pText ) ,byte,proc
Return Values
Example:
|
| Italic
( byte pOption ) ,byte,proc MyWord.Italic (oiw:ItalicToggle) TempByte = MyWord.Italic (oiw:ItalicToggle)
|
| Kill
( byte UnloadCOM=1 ) ,byte,proc MyWord.Kill() TempByte = MyWord.Kill()
|
|
LinesToPoints
( string pLines ) ,string loc:Points = MyWord.LinesToPoints(5) MyWord.Update(oiw:PageLeftMargin, MyWord.LinesToPoints(5))
|
| MailMergeGetRecord
( byte pOption=0 ) ,byte,proc MyWord.MailMergeGetRecord ()
|
| MailMergeRun
( ) ,byte,proc MyWord.MailMergeRun() TempByte = MyWord.MailMergeRun()
|
| MailMergeSetDataSource
( string DataSourceName, string ConnectionString, string SQLStatement
) ,byte,proc MyWord.MailMergeSetDataSource ( (longpath() & '\Addresses.mdb'), 'TABLE Office_Address_List', 'SELECT * FROM [Office_Address_List]' )
|
|
MillimetersToPoints
( string pMillimeters ) ,string loc:Points = MyWord.MillimetersToPoints(10) MyWord.Update(oiw:PageLeftMargin, MyWord.MillimetersToPoints(1.10))
|
| MoveDown
( byte pUnit=oiw:UnitLine, long pCount=1, byte pExtend=oiw:Move
) ,byte,proc MyWord.MoveDown() ! move down one line
|
| MoveLeft
( byte pUnit=oiw:UnitCharacter, long pCount=1, byte pExtend=oiw:Move
) ,byte,proc MyWord.MoveLeft() ! move left one character
|
| MoveRight
( byte pUnit=oiw:UnitCharacter, long pCount=1, byte pExtend=oiw:Move
) ,byte,proc MyWord.MoveRight() ! move right one character
|
| MoveUp
( byte pUnit=oiw:UnitLine, long pCount=1, byte pExtend=oiw:Move
) ,byte,proc MyWord.MoveUp() ! move up one line
|
| NewDoc
( <string TemplateName> ) ,byte,proc MyWord.NewDoc() TempByte = MyWord.NewDoc() MyWord.NewDoc ('MyTemplate.dot') ! assumes system default template directory MyWord.NewDoc (longpath() & '/templates/MyTemplate.dot')
|
| NextLine
( ) ,byte,proc MyWord.NextLine() TempByte = MyWord.NextLine()
|
| OpenDoc
( string pFileName, byte pReadOnly=false, byte pAddToRecentFiles=false,
<string pPassword> ) ,byte,proc MyWord.OpenDoc('c:\test.doc') TempByte = MyWord.OpenDoc('c:\test.doc')
|
| OpenFooter
( ) ,byte,proc MyWord.OpenFooter()
|
| OpenHeader
( ) ,byte,proc MyWord.OpenHeader()
|
| Paste
( ) ,byte,proc MyWord.Paste() TempByte = MyWord.Paste()
|
|
PicasToPoints
( string pPicas ) ,string loc:Points = MyWord.PicasToPoints(8) MyWord.Update(oiw:PageLeftMargin, MyWord.PicasToPoints(8))
|
|
PixelsToPoints
( string pPixels, byte pVertical=false ) ,string loc:Points = MyWord.PixelsToPoints(15) MyWord.Update(oiw:PageLeftMargin, MyWord.PixelsToPoints(15))
|
| PointsToCentimeters
( string pPoints ) ,string loc:Points = MyWord.PointsToCentimeters(6) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToCentimeters(6))
|
| PointsToInches
( string pPoints ) ,string loc:Points = MyWord.PointsToInches(14) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToInches(14))
|
| PointsToLines
( string pPoints ) ,string loc:Points = MyWord.PointsToLines(8) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToLines(8))
|
| PointsToMillimeters
( string pPoints ) ,string loc:Points = MyWord.PointsToMillimeters(14) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToMillimeters(14))
|
| PointsToPicas
( string pPoints ) ,string loc:Points = MyWord.PointsToPicas(12) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToPicas(12))
|
|
PointsToPixels
( string pPoints, pVertical=false ) ,string loc:Points = MyWord.PointsToPixels(13) MyWord.Update(oiw:PageLeftMargin, MyWord.PointsToPixels(13))
|
| PrintDialog
( ) ,byte,proc MyWord.PrintDialog() TempByte = MyWord.PrintDialog()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PrintMe (<string pPages>, byte pRange=oiw:PrintAllDocument, long pCopies=1, byte pPageType=oiw:PrintAllPages, byte pBackground=false, <string pPrinterName>) ,byte,proc 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
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: 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 TempByte = MyWord.PrintMe ()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PrintOut (*oiwPrintProperties printSettings, string printerName) 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 *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) string printName The name of the printer to use for printing. Return Values Returns 1 for success and zero if the COM interface encountered an error. Data Types
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PrintPreview
( ) ,byte or ( byte pOption ) ,byte,proc
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 (long
protectionType, string pPassword),
long Enables do | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||