H
hurryman
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var template,newtemplate,documenttype,visablelevariant ;
myWord, myDoc: variant;
begin
try
myWord := CreateOleObject('word.application');
except
MessageDlg('sorry !', mtInformation,
[mbOk], 0);
exit;
end;
try
myWord.Visible := true;
myDoc := myWord.Documents.Open('d:/2.dot');
myDoc.BookMarks.Item('bookmark1').Select;
myWord.Selection.Text := '厂';
myDoc.BookMarks.Item('bookmark2').Select;
myWord.Selection.Text := '才';
mydoc.bookmarks.item('booKmark3').select;
myword.selection.text :='8881206';
mydoc.bookmarks.item('bookmark4').select;
myword.selection.text :='来料加工';
mydoc.bookmarks.item('bookmark5').select;
myword.selection.text :='号';
mydoc.bookmarks.item('bookmark6').select;
myword.selection.text :='陈红玉';
mydoc.bookmarks.item('bookmark7').select;
myword.selection.text :='女';
mydoc.bookmarks.item('bookmark8').select;
myword.selection.text :='19';
mydoc.bookmarks.item('bookmark9').select;
myword.selection.text :='30910798';
mydoc.bookmarks.item('bookmark10').select;
myword.selection.text :='宿舍';
mydoc.bookmarks.item('bookmark11').select;
myword.selection.text :='四川省';
myWord.Activate;
//在这里我想让打印机把生成的文档立即打印出来。并且WORD没有显示出来,给
//用户的感觉我没有使用WORD那样。
//这个句子怎么写?
myDoc.SaveAs('d:/1.doc');
finally
myword.quit ;
end;
end;
end.
var template,newtemplate,documenttype,visablelevariant ;
myWord, myDoc: variant;
begin
try
myWord := CreateOleObject('word.application');
except
MessageDlg('sorry !', mtInformation,
[mbOk], 0);
exit;
end;
try
myWord.Visible := true;
myDoc := myWord.Documents.Open('d:/2.dot');
myDoc.BookMarks.Item('bookmark1').Select;
myWord.Selection.Text := '厂';
myDoc.BookMarks.Item('bookmark2').Select;
myWord.Selection.Text := '才';
mydoc.bookmarks.item('booKmark3').select;
myword.selection.text :='8881206';
mydoc.bookmarks.item('bookmark4').select;
myword.selection.text :='来料加工';
mydoc.bookmarks.item('bookmark5').select;
myword.selection.text :='号';
mydoc.bookmarks.item('bookmark6').select;
myword.selection.text :='陈红玉';
mydoc.bookmarks.item('bookmark7').select;
myword.selection.text :='女';
mydoc.bookmarks.item('bookmark8').select;
myword.selection.text :='19';
mydoc.bookmarks.item('bookmark9').select;
myword.selection.text :='30910798';
mydoc.bookmarks.item('bookmark10').select;
myword.selection.text :='宿舍';
mydoc.bookmarks.item('bookmark11').select;
myword.selection.text :='四川省';
myWord.Activate;
//在这里我想让打印机把生成的文档立即打印出来。并且WORD没有显示出来,给
//用户的感觉我没有使用WORD那样。
//这个句子怎么写?
myDoc.SaveAs('d:/1.doc');
finally
myword.quit ;
end;
end;
end.