我用delphi向word写入三段话,第一段是居中字体为一号粗体。第二段是正常五号,居左第三段是居右字体为三号。请问是什么属性可以控制呀。已经定改文件了。 
但就是排不了版。 
帮帮我吧各位大哥谢了。

解决方案 »

  1.   

    Selection.TypeText Text:="WQEQWREWQR"
        Selection.MoveLeft Unit:=wdCharacter, Count:=11, Extend:=wdExtend
        Selection.Font.Name = "宋体"
        Selection.Font.Size = 16
        Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        Selection.EndKey Unit:=wdLine
        Selection.TypeParagraph
        Selection.TypeText Text:="ASDADA"
        Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
        Selection.Font.Size = 10.5
        Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
        Selection.EndKey Unit:=wdLine
        Selection.TypeParagraph
        Selection.TypeParagraph
        Selection.TypeText Text:="ASDADA"
        Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
    更复杂的操作请用word中的“宏录制”功能。
      

  2.   

    可用WORDDOCUMENT.Paragraph(1).rang.进行处理
      

  3.   

    使用录制宏吧!
    TempColWidth := 0;
      TempSerialNum := 0;
      TempAlign := 0;
      TempMovePos := 0;
      if FAlign.Strings[Temp] = '+' then       //左对齐
        TempAlign := 3
      else if FAlign.Strings[Temp] = '-' then  //右对齐
        TempAlign := 2
      else if FAlign.Strings[Temp] = '|' then  //中间对齐
        TempAlign := 1;
      TempColWidth := StrToFloat(FWidths.Strings[Temp]);
      //取出标题要插入的列
      TempSerialNum := StrToInt(FSerialNum.Strings[Temp]);
      if FTiltles.Strings[Temp] = '该列标题为空' then
        MsTable.Cell(1,TempSerialNum).Range.Text := ''
      else
        MsTable.Cell(1,TempSerialNum).Range.Text := FTiltles.Strings[Temp];
      if Temp = 0 then
      begin
        //光标移动到第二行;
        MsAppl.Selection.Move( 10, 1);
        MsAppl.Selection.ParagraphFormat.Alignment := TempAlign;
        MsAppl.Selection.Columns.PreferredWidth := 28.3*TempColWidth;
      end
      else begin
        //取出要移动的列位置;
        TempMovePos := StrToInt(FSerialNum.Strings[Temp-1]);
        //磅与厘米之间的转换,设置列的宽度
        MsAppl.Selection.MoveRight(12, TempSerialNum-TempMovePos, 1);
        MsAppl.Selection.ParagraphFormat.Alignment := TempAlign;
        MsAppl.Selection.Columns.PreferredWidth := 28.3*TempColWidth;
      end;这是一段关于对齐方式、字体大小的操作,不知是否对你有作用