我在delphi中用createoleobject生成一个word文档,但是对其中的一些属性赋值老出错,其中有一个例子:try
     MSWord:=GetActiveOleObject('Word.Application');
  except
     try MSWord:= CreateOleObject('Word.Application');
     except
         MessageBox(null,'Word未安装或加载OLE出错!','出错信息',MB_OK);
         exit;
  end;  end;
  MSWord.Visible:=true;
  MSWord.Documents.Add;
  MSWord.Caption:='新文档';
  MSWord.Selection.TypeParagraph;
  MSWord.Selection.TypeText(Text:='文章标题');
  MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter;
  MSWord.Selection.Font.Size := 16;本意就是在word中插入文章标题,然后设置其居中,改变字体。这在word的VBA中运行良好,但是在delphi中运行到MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter就出错,说是参数不对,我给word当中的一些属性赋值时老出错,请问应该怎么解决?谢谢各位了。还有在word中怎么用宏插入图表(如柱状图、饼状图等)?不胜感激。