Home > Back-end >  Delphi using DSOFramer creates an object (word) how to assign WORD_TLB object
Delphi using DSOFramer creates an object (word) how to assign WORD_TLB object

Time:09-26

Delphi using DSOFramer creates an object (word), but the ocx very few methods to the operation of the word,
Create the application object, then, how to assign WORD_TLB object?

I test the code for the time being, should be most can call function, but some function can't seem to call, no reaction

 
//DSOFramer create objects
TFramerControl. Create (Self);

With FDSOFramer do
The begin
Parent:=AParent;
Align:=alClient;//center
Visible:=True;//visible
Titlebar:=false;//title bar
Menubar:=false;//toolbar
//Toolbars:=false;//
FDSOFramer. Activate;
The end;
//DSOFramer open a document
Var
OFalse: OleVariant;
OWord: OleVariant;
OOwner: OleVariant;

OFalse:=false;//whether the read-only
//OOwner:='Word. Application;
OWord:='Word. The Document';
Result:=false;
FDSOFramer. Close;
FDSOFramer. Open (AWord, oFalse oWord);
//object to WORD_TLB
//here only to the application, not to the document object,
//here if there are other objects, then can let WORD_TLB object more comprehensive integration into the DSOFramer create the object?


WordApp: WordApplication;//WORD_TLB

Try
WordApp:=GetActiveOleObject (' Word. Application) as WordApplication;
Except,
On e: the exception do
The begin
Application. MessageBox (pchar (' type conversion error! Message: '+ e.M essage),' prompt ',
MB_ICONASTERISK);
end;
end;


Question:
//here only to the application, not to the document object,
//here if there are other objects, then can let WORD_TLB object more comprehensive integration into the DSOFramer create the object?
  • Related