如何判断一个Word的纸张类型

zilong4460072 2010-11-02 10:08:14
就是判断一个Word文档是A4还是B4的 哪位仁兄有类型的代码 分享一下阿
...全文
84 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zilong4460072 2010-11-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bloodish 的回复:]
C# code

//A4
if(wordApp.ActiveDocument.PageSetup.PageWidth == wordApp.CentimetersToPoints(29.7f) &&
wordApp.ActiveDocument.Page……
[/Quote]

我试试哈
wuhuabucai 2010-11-02
  • 打赏
  • 举报
回复
这个得标记
porschev 2010-11-02
  • 打赏
  • 举报
回复
没研究。。。up
bloodish 2010-11-02
  • 打赏
  • 举报
回复

//A4
if(wordApp.ActiveDocument.PageSetup.PageWidth == wordApp.CentimetersToPoints(29.7f) &&
wordApp.ActiveDocument.PageSetup.PageHeight == wordApp.CentimetersToPoints(21f))
{
//todo
}

//B4
if (wordApp.ActiveDocument.PageSetup.PageWidth = wordApp.CentimetersToPoints(36.4f) &&
wordApp.ActiveDocument.PageSetup.PageHeight = wordApp.CentimetersToPoints(25.7f))
{
//todo
}

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧