uses...Comobj;procedure TGROUPING_FORM.FlatButton1Click(Sender: TObject);
VAR WordApp,WordDoc,WordTable:olevariant;
SceneVar:integer;
SceneNum:integer;
Str:string;
Begin
WordApp:=CreateOleObject('Word.Application'); //连接Word
WordApp.Visible:=True; //设窗口为视为
WordDoc:=WordApp.Documents.Add; //添加空白页
WordApp.Selection.Font.Size:=14;
WordApp.Selection.Font.Name:='宋体';
WordApp.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter; //uses ......word97
WordApp.Selection.Font.Bold:=false;
WordApp.Selection.TypeText('竞赛分组分道表');
Wordapp.Selection.TypeParagraph; WordTable:=WordDoc.Tables.Add(WordApp.Selection.Range,8,6);
WordApp.Selection.Font.Size:=10.5;
WordApp.Selection.Font.Name:='宋体';
WordApp.Selection.ParagraphFormat.Alignment:=WdAlignParagraphLeft;
WordApp.Selection.Font.Bold:=false;
WordApp.Selection.TypeText('sldfsaldjflk');
End;
为什么WordApp.Selection.TypeText('sldfsaldjflk');这一句写的字符老是在WordTable:=WordDoc.Tables.Add(WordApp.Selection.Range,8,6);这一句的表格内呢?怎么解决
VAR WordApp,WordDoc,WordTable:olevariant;
SceneVar:integer;
SceneNum:integer;
Str:string;
Begin
WordApp:=CreateOleObject('Word.Application'); //连接Word
WordApp.Visible:=True; //设窗口为视为
WordDoc:=WordApp.Documents.Add; //添加空白页
WordApp.Selection.Font.Size:=14;
WordApp.Selection.Font.Name:='宋体';
WordApp.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter; //uses ......word97
WordApp.Selection.Font.Bold:=false;
WordApp.Selection.TypeText('竞赛分组分道表');
Wordapp.Selection.TypeParagraph; WordTable:=WordDoc.Tables.Add(WordApp.Selection.Range,8,6);
WordApp.Selection.Font.Size:=10.5;
WordApp.Selection.Font.Name:='宋体';
WordApp.Selection.ParagraphFormat.Alignment:=WdAlignParagraphLeft;
WordApp.Selection.Font.Bold:=false;
WordApp.Selection.TypeText('sldfsaldjflk');
End;
为什么WordApp.Selection.TypeText('sldfsaldjflk');这一句写的字符老是在WordTable:=WordDoc.Tables.Add(WordApp.Selection.Range,8,6);这一句的表格内呢?怎么解决
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货