救命!为什么TWordApllication.Selection总是空0x0000000?附代码....(50分)

  • 主题发起人 主题发起人 Coolfaery
  • 开始时间 开始时间
C

Coolfaery

Unregistered / Unconfirmed
GUEST, unregistred user!
var
Template,NewTemplate,ItemIndex,_WordDocumentType,_Visible,_FileName:OleVariant;
_InsertText : OleVariant;
begin
NewTemplate := False;
BigIndex := 0;
SmallIndex := 0;
//Template := ExtractFilePath(Application.ExeName) + 'Output.dot';
Template := EmptyParam;
//ShowMessage(ExtractFilePath(Application.ExeName) + 'Output.dot');
_WordDocumentType:=wdNewBlankDocument;
_Visible:=False;

PaperWord.Connect;
PaperWord.Documents.Add(Template, NewTemplate, _WordDocumentType,_Visible);
PaperWord.Selection.TypeText('');
 
后退
顶部