如何调用出word的内置对话框(100分)

  • 主题发起人 主题发起人 dsfsadf1231
  • 开始时间 开始时间
D

dsfsadf1231

Unregistered / Unconfirmed
GUEST, unregistred user!
如何调用出word的内置对话框
 
uses ComObj;
procedure DocPageSetup(const DocFileName: string);
const
wdAlertsNone = $00000000;
wdDialogFilePageSetup = $000000B2;
var
DocApp: OleVariant;
begin
try
try
DocApp := CreateOleObject('Word.Application');
DocApp.DisplayAlerts := wdAlertsNone;
DocApp.Documents.Open(DocFileName);
DocApp.Dialogs.Item(wdDialogFilePageSetup).Show;
DocApp.Visible := False;
DocApp.ActiveDocument.Save;
except
end;
finally
if not VarIsEmpty(DocApp) then
DocApp.Quit;
DocApp := Unassigned;
end;
end;
 
多人接受答案了。
 
后退
顶部