TOleanderWord7/8 Methods

CopyClip
Declaration
procedure CopyClip;
Description

The CopyClip method copies the current selection of the current WinWord7 document into the Windows clipboard.

 

CopyDoc
Declaration
procedure CopyDoc;
Description

The CopyDoc method creates a new document in WinWord7 and loads the document specified in DocName into the new document.

 

Close
Declaration
procedure Close;
Description

The Close method closes the OLE automation object and removes it.

 

Create
Declaration
constructor Create(AOwner: TComponent);
Description

The Create method allocates memory to create the component and initializes its data as needed. Each object can have a Create method customized to create that particular kind of object. The owner of the created component is passed in the AOwner parameter.

Usually you don't need to create objects manually. Objects you design in Delphi are automatically created for you when you run the application and destroyed when you close the application.

If you construct a component by calling Create, and give it an owner, the owner disposes of the component when the owner is destroyed. If you don't want another component to own the created component, pass Self in the AOwner parameter.

 

DeleteSelection
Declaration
procedure DeleteSelection;
Description

The DeleteSelection method deletes the current selection in the current WinWord7 document.

 

Destroy
Declaration
destructor Destroy;
Description

The Destroy method destroys the object, component, or control and releases the memory allocated to it.

You seldom need to call Destroy. Objects designed with Delphi create and destroy themselves as needed, so you don't have to worry about it. If you construct an object by calling the Create method, you should call Free to release memory and dispose of the object. Free checks to see if the pointer is nil before calling Destroy and is also more efficient in code size.

 

FormatString
Declaration
function.FormatString(ASource: string; AIdentifier: TOleanderIdentifier) : string;
Description

The FormatString method formats the Asource string using the Delphi FormatFloat, FormatCurr and FormatDateTime procedures. The type of formating is determined by the AIdentifier.Datatype property, the format mask by the AIdentifier.Mask property. If the type is undefined or the mask is empty, the result of FormatString will be ASource.

 

FreeDoc
Declaration
procedure FreeDoc;
Description

The FreeDoc method frees the current document from WinWord7.

 

GetSelection
Declaration
function.GetSelection: string;
Description

The GetSelection method returns the current selection in the current WinWord7 document as a string.

 

GotoIdentifier
Declaration
procedure GotoIdentifier(AIdentifier: TOleanderIdentifier; 
APos: TOleanderGotoPosition);
Description

The GotoIdentifier method sets the WinWord7 cursor at the position determined by the AIdentifier and APos parameters. The WinWord7 bookmark specified by AIdentifier.Name will be selected. If APos is ogpStart the cursor will be positioned at the start of the selection, if APos is ogpEnd the cursor will be positioned at the end.

 

GotoPos
Declaration
procedure GotoPos(APos: TOleanderGotoPosition);
Description

The GotoPos method sets the WinWord7 cursor at the position determined by the APos parameters. If APos is ogpStart the cursor will be position at the start of the document, .if APos is ogpEnd the cursor will be position at the end of the document.

 

InsertClip
Declaration
procedure InsertClip;
Description

The InsertClip method inserts the current Windows clipboard contents into the current WinWord7 document cursor position.

 

InsertText
Declaration
procedure InsertText(ASource: string);
Description

The InsertText method inserts the string in ASource into the current WinWord7 document cursor position. An existing selection in the current WinWord7 document will be deleted, even if ASource is empty.

 

LoadDoc
Declaration
procedure LoadDoc;
Description

The LoadDoc method loads the WinWord7 document specified in the DocName property into Word.

 

Open
Declaration
procedure Close;
Description

The Open method creates the OLE automation object.

If the application used as OLE server is not installed on your system calling Open will raise an exception because no OLE object could be created. Call Close to stop the OLE server running.

 

PrintDoc
Declaration
procedure PrintDoc;
Description

The PrintDoc method prints the current WinWord7 document. If the PrinterName property is set, Oleander tries to set the specified printer before printing.

Note: See the WinWord7 printername specialties specified in PrinterName

 

RemoveIdentifier
Declaration
procedure RemoveIdentifier(const AIdentifier: TOleanderIdentifier);
Description

The RemoveIdentifier method removes the WinWord7 bookmark specified in the AIdentifier.Name property from the current WinWord7 document.

 

ReplaceIdentifier
Declaration
procedure ReplaceIdentifier(AIdentifier: TOleanderIdentifier; ASource: string; 
AFormat: boolean; AInClipboard: boolean);
Description

The ReplaceIdentifier method replaces the contents of the WinWord7 bookmark specified in the AIdentifier.Name property with the ASource string.If AFormat is True, the ASource string will be formated according to the fieldtype and mask specified in AIdentifier using the FormatString method.

If AInClipboard is True, ReplaceIdentifier will not use the ASource string to replace the bookmark but the current contents of the Windows clipboard;

 

ReplaceName
Declaration
procedure ReplaceName(AName: string; ASource: string; 
AFormat: boolean; AInClipboard: boolean);
Description

The ReplaceName method tries to find the identifier named AName in the Identifiers list and then calls the ReplaceIdentifier method using its parameters.

 

SelectDoc
Declaration
procedure SelectDoc(ADoc: TOleanderWorkdoc);
Description

The SelectDoc method switches between the WinWord7 documents specified in the ADoc parameter.

Set ADoc to:

owdRunning to select the document that was the current when Oleander found a running WinWord7.

owdOriginal to select the document loaded using the DocName property.

owdTemp to select the document created by Oleander containing the print results.

 

SelectIdentifier
Declaration
procedure SelectIdentifier(AIdentifier: TOleanderIdentifier);
Description

The SelectIdentifiers method selects the WinWord7 bookmark specified in the AIdentifier name property in the current document.

 

SetPrinter
Declaration
procedure SetPrinter(APrinter: string);
Description

The SetPrinter method tries to set the printer specified in the APrinter parameter as the current WinWord7 printer.

Note: SetPrinter is called by Oleander prior at every call to the PrintDoc method using the PrinterName property as parameter.

 

SetViewmode
Declaration
procedure SetViewmode(AViewmode: TOleanderViewmode);
Description

The SetViewmode method switches the current document into the viewmode specified in the AViewmode parameter.