Rapid-Q Documentation by William Yu (c)1999 | Appendix A: QOLEOBJECT |
Field | Type | R/W | Default |
Container | QOLECONTAINER | W |
Method | Type | Description | Params |
CreateObject | FUNCTION (ClassName AS STRING) AS INTEGER | Create COM object, with actual name or CLSID | 1 |
CreateRemote | FUNCTION (Host AS STRING, ClassName AS STRING) AS INTEGER | Create remote COM object, with actual name or CLSID | 2 |
Free | SUB | Release object | 0 |
GetIDofName | FUNCTION (Name AS STRING) AS INTEGER | Returns the ID of an identifier, good for checking if it exists. Returns -1 if name is not found. | 1 |
GetObject | FUNCTION (ClassName AS STRING) AS INTEGER | Get active COM object, with actual name or CLSID | 1 |
Invoke | FUNCTIONI (ID AS STRING, Params, ...) AS VARIANT | Invoke method/property | Infinite |
InvokeCopy | SUB (ID AS STRING, Object AS QOLEOBJECT) | Copy object (might not work... yet) | 2 |
Event | Type | Occurs when... | Params |
Word.Basic
Methods
- WRDBASIC.HLP
Method | Params | Type | Description |
FileOpen | FileName | string | The name of the document (paths are accepted). |
ConfirmConversions | integer | True to display the Convert File dialog box if the file isn't in Microsoft Word format | |
ReadOnly | integer |
True to open the document as read-only. Note This argument doesn't override the read-only recommended setting on a saved document. For example, if a document has been saved with read-only recommended turned on, setting the ReadOnly argument to False will not cause the file to be opened as read/write. |
|
AddToMru | integer | . True to add the file name to the list of recently used files at the bottom of the File menu. | |
DummyParam | integer | Needed for XP Office | |
PasswordDoc | string | The password for opening the document. | |
PasswordDot | string | The password for opening the template. | |
Revert | long | Controls what happens if
FileName is the name of an open document. True to discard any unsaved changes to the open document and reopen the file. False to activate the open document. |
|
WritePasswordDoc | string | The password for saving changes to the document. | |
WritePasswordDot | string | The password for saving changes to the template. | |
Dummy | string | ||
Dummy | string | ||
Dummy | string | ||
FormatOpen | long | The file converter to
be used to open the document. Can be one of the following constants
wdOpenFormatAuto = 0 |
|
CodePage | long | The document encoding (code page or character set) to be used by Microsoft Word when you view the saved document. Can be any valid MsoEncoding constant. | |
Visible | long | True if the document is opened in a visible window. The default value is True. | |
DummyParam | long | ||
OpenConflictDocument | long | Specifies whether to open the conflict file for a document with an offline conflict. | |
OpenAndRepair | long | True to repair the document to prevent document corruption. | |
DocumentDirection | long | Indicates the
horizontal flow of text in a document. wdLeftToRight = 0 wdRightToLeft = 1 |
|
NoEncodingDialog | long | . True to skip displaying the Encoding dialog box that Word displays if the text encoding cannot be recognized. The default value is False. |
' This example requires MS WORD ' If you're using a localized version with a foreign language, ' you'll have to adjust the parameter names to match. ' Comments in italics indicate the old style syntax before ' type checking was disabled. You can choose either approach. $ESCAPECHARS ON DIM Object AS QOLEOBJECT 'Object.CreateObject("{000209FE-0000-0000-C000-000000000046}") Object.CreateObject("Word.Basic") 'Object.Invoke("AppShow") Object.AppShow 'Object.Invoke("AppMaximize", "", 1) Object.AppMaximize("", 1) 'Object.Invoke("FileNew") Object.FileNew PRINT Object.Bold '-- is bold enabled? Object.Insert("Hello world!\n") Object.Bold PRINT Object.Bold '-- Bold should be enabled Object.Insert("Rapid-Q is awesome!\n") Object.Bold(0) '-- Turn Bold off SLEEP 5 Object.Free
----------------------------------------------
DIM WordObject AS QOLEOBJECT filename$="C:\BAS\RAPIDQ\ole\hamai40.doc" ConfirmConversions=1 ReadOnly=0 AddToRecentFiles =1 DummyInt=0 PasswordDoc$="qq" PasswordTmp$ ="rr" Revert =0 WritePasswordDocument$ ="" WritePasswordTemplate$ ="" DummyStr="" '--------------------------' FormatOpen =5'' wdOpenFormatEncodedText CodePage =866 Visible =1 OpenConflictDocument =1 OpenAndRepair =1 DocumentDirection =1 NoEncodingDialog =1 WordObject.CreateObject("Word.Basic") WordObject.AppShow with WordObject .fileOpen(filename$,ConfirmConversions,ReadOnly, AddToRecentFiles ,DummyInt, PasswordDoc$, PasswordDoc$, Revert , _ WritePasswordDocument$,WritePasswordTemplate$,DummyStr$,DummyStr$,DummyStr$,FormatOpen ,CodePage,Visible, _ DummyParam,OpenConflictDocument,OpenAndRepair,DocumentDirection,NoEncodingDialog) .TableInsertTable(0, 3, 5) .Free end with
Prev Component | Contents | Next Component |