当前位置:编程学习 > C#/ASP.NET >>

C#生成word如何设置整篇文档的字体

   C#生成word如何设置整篇文档的字体,大小,谁知到用具体用的是那个属性请告知,
   哪位朋友有C#生成word的相关帮助的下载地址也请给我发一个,不胜感激!
  
多谢! --------------------编程问答-------------------- 可以参考msdn如何:在文档中设置文本格式 

private void RangeFormat() 

    // Set the Range to the first paragraph. 
    Word.Range rng = this.Paragraphs[1].Range; 

    // Change the formatting. 
    rng.Font.Size = 14; 
    rng.Font.Name = "Arial"; 
    rng.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;

    rng.Select(); 
    MessageBox.Show("Formatted Range"); 

    // Undo the three previous actions. 
    object numTimes3 = 3; 
    this.Undo(ref numTimes3); 

    rng.Select(); 
    MessageBox.Show("Undo 3 actions"); 

    // Apply the Normal Indent style. 
    object indentStyle = "Normal Indent"; 
    rng.set_Style(ref indentStyle); 

    rng.Select(); 
    MessageBox.Show("Normal Indent style applied"); 

    // Undo a single action. 
    object numTimes1 = 1; 
    this.Undo(ref numTimes1); 

    rng.Select(); 
    MessageBox.Show("Undo 1 action"); 
}
--------------------编程问答-------------------- 另外,整篇文档是Document.Content
…… --------------------编程问答-------------------- 多谢回答!!!!!!!!!
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,