使用OpenXML无法读取word文档的实际自动编号 [英] Actual auto numbers of word document are not reading using OpenXML

查看:199
本文介绍了使用OpenXML无法读取word文档的实际自动编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我们在应用程序中使用openXML来读取word文档内容。在我们开始阅读实际文档内容之前,我们使用openxml FormattingAssembler类(https://github.com/VisualOn/OpenXmlPowerTools-old/blob/master/FormattingAssembler.cs)和ListItemRetriver
类(https:// github)的.com /视龙/ OpenXmlPowerTools岁/斑点/主/ ListItemRetriever.cs) 阅读列表编号/文件的自动编号。 
$


我有一个文件,在分节后,自动编号从1重置,但即使数字重置并且值从1开始,Open Xml连续读取自动数字。



例如:在附件中我标记了黄色的段落,其值为改变。在第2页中,段落从1开始,但它是从第一页开始连续读取6,其余的自动数字也被错误地读取,
在6之后被读为7而不是2。 br />


有什么方法可以让我们如何在分节后重置自动数字或如何在分节后读取文件的实际自动编号?



谢谢,

Gayatri

解决方案

嗨  GayatriK,


请检查以下链接中的解决方案是否适合您:


无法使用OpenXML


请随时提出任何问题。期待收到您的回复。


最好的问候,


Yuki


Hi,

We use openXML in our application to read the word document content. And before we start to read actual document content we use openxml FormattingAssembler class(https://github.com/VisualOn/OpenXmlPowerTools-old/blob/master/FormattingAssembler.cs) and ListItemRetriver class (https://github.com/VisualOn/OpenXmlPowerTools-old/blob/master/ListItemRetriever.cs)  to read the list numbers/Auto numbers of the document. 

I have a document where after section break the auto numbers are resetting from 1 but even though the numbers are reset and have values are starting from 1, Open Xml is reading auto numbers continuously.

Ex : In the attached document I have marked the paragraphs in yellow whose values are changing. In page no 2 the paragraphs are starting from 1 but it is reading as 6 which is continuous from first page and rest of the auto numbers are also read wrongly that is after 6 it is read as 7 instead of 2.

Is there any way how we can make auto numbers to reset after section break or How to read the actual auto number of the document after section break ?

Thanks,
Gayatri

解决方案

Hi GayatriK,

Please check if the solution in the following link works for you:

Not able to read actual auto numbers of word document using OpenXML

Please feel free to ask any questions. Looking forward to hearing from you.

Best Regards,

Yuki


这篇关于使用OpenXML无法读取word文档的实际自动编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆