确定是否选中了word文档中的复选框 - c#中的char u0015、microsoft.office.interop.word

朱利安·贝克托德

必备信息

有一个包含以下单元格的 word 文档: 在此处输入图片说明

使用 Microsoft.Office.Interop.Word 访问像这样的单元格文本:

Document doc = ap.Documents.Open(path, ReadOnly: true, Visible: false);
Table docTable = doc.Tables[1];
string field = table.Rows[12].Cells[2].Range.Text

文本结果是:

\ u0015 将从employee 接管(将由MA 接管)
\ u0015 需要订购(必须
重新订购\ u0015 不需要笔记本电脑/PC(不需要笔记本电脑/PC)

问题

\u0015是word文件中的小复选框。但无论是否选中复选框,字符表示都是\u0015.

有没有办法确定是否选中了小复选框\u0015 no need for Laptop/PC (braucht kein Laptop/PC)

尤金·阿斯塔菲耶夫

您可以使用FormFieldsDocument 类属性来访问控件。然后您可以使用CheckBox属性,属性返回一个CheckBox表示复选框表单字段对象。

ActiveDocument.FormFields(1).CheckBox.Value = False

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

我如何创建接口Microsoft.Office.Interop.Word.Application的新实例

Microsoft.Office.Interop.Word OMath

可以将DebuggerDisplay属性应用于Microsoft.Office.Interop.Word.Range吗?

是否可以使用Microsoft.Office.Interop.Word以编程方式从Word文档中删除行号?

C#-TableOfContent条目的Office Interop Word格式缩进

如何使用Microsoft.Office.Interop.Word库删除输出中的段落间距

Microsoft.Office.Interop.Word:在C#中为图像添加标题

使用f#Microsoft.Office.Interop.Word搜索和替换

C#Microsoft.Office.Interop.Word SpellingChecked不返回真实值

机器中的单独Microsoft.Office.Interop.Word实例和Word应用程序

使用Microsoft.Office.Interop.Word启用内置的Microsoft Word按钮控件

使用Microsoft.Office.Interop Word和Excel

使用参考C#添加Microsoft.Office.InterOp.Word

Microsoft.Office.Interop.Word.WdRelativeHorizontalPosition出现C#编译器错误;

在VBScript中使用Microsoft.Office.Interop.Word枚举常量

使用Office Interop程序集在Word页眉/页脚中获取内容控件

Microsoft.Office.Interop.Word中仅可访问的第一页

带有C#的Microsoft.Office.Interop.Word-标识现有目录对象

无法使用microsoft.office.interop.word在当前一字之后插入图像

Microsoft.Interop.Office.Word完整样式不适用

C# Microsoft.Office.Interop.Word 替换为 Selection.Find.Execute() 超过第一个单词

如何使用 Microsoft.Office.Interop.Word 在 C# 中编辑 docx 文件

c# 如何在 Microsoft Interop Word 中编写

C# Microsoft.Office.Interop.Word 保护段落

如何通过 Microsoft.Office.Interop.Word 在 wdRevisionsViewFinal 中将 word 转换为 html?

将一个文档插入另一个 Microsoft.Office.Interop.Word

VSTO:在数据库中存储 __ComObject (Microsoft.Office.Interop.Word.Table)

Microsoft.Office.Interop.Word - Word 在尝试打开文件时遇到错误

如何使用office.interop.word库在c#中的表格中插入标题