C# 中的 Word 自动化 - 在 Word 中创建表格
我有一个 C# 应用程序,它将打开一个 Word 文档,然后用我拥有的数据(如名称、类等)替换一些预定义的书签。
这一切都只是字符串值。现在我想渲染一个带有动态数字的表格Word 文档的行数。我希望该表位于文档中的特定位置。
我可以为此使用书签吗?如果可以怎么办??? 还有其他方法吗?
I have a C# application which will open a word document and then replace some of the predefined bookmarks with the data which i have like Name,Class etc..
It is all are just string values .Now I want to render a Table with dynamic number of rows to the word document.I want the table in a particular place in the document.
Can i use bookmark for this.If so how ??? IS there any other method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以使用书签,也可以使用字段将其替换为带有n号的表。 行数和 n 数。 列。
您可以循环遍历字段并获取其范围,并使用范围您可以在字段位置添加表:
Yes, you can use bookmarks and also use fields to replace it with table with n no. of rows and n no. of columns.
You can loop through fields and get its range and using range you can add table at field location: