admin管理员组

文章数量:1534191

2024年6月20日发(作者:)

在word文档中创建表格的方法详解

在word文档中创建表格的方法详解

在word文档中创建表格的方法详解

复制代码 代码如下:

public string CreateWordFile()

{

string message = "";

try

{

Object Nothing = ;

string name = "";

object filename = @"C:Usersxiehuanxxx" + name; //文件保存路径

//创建Word文档

ation

ationClass();

WordApp = new

nt WordDoc =

(ref Nothing, ref Nothing, ref Nothing, ref Nothing);

//添加页眉

= ineView;

ew

PrimaryHeader;

=

After("[页眉内容]");

ent =

nParagraphRight;//

设置右对齐

ew

MainDocument;//跳出页眉设置

=

acing = 15f;//设置文档的行间距

//移动焦点并换行

本文标签: 文档方法创建表格页眉代码