C#Interop字符串搜索 [英] C# Interop string search

查看:100
本文介绍了C#Interop字符串搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习C#,并希望代码循环Microsoft Word 2010文档中的所有页面,并查找页眉,正文和页脚中是否存在字符串,并将结果打印到文本文件中。

示例:查找某个日期是否在Microsoft Word 2010文档的每个页面的页眉,正文和页脚中。如果在第5页的标题中找不到日期,则打印日期不在第5页的标题中。

I am just learning C# and would like code to loop all pages in a Microsoft Word 2010 document and find if a string exists in the page header, body, and footer and print the results to a text file.
Example: Find if a certain date is in the header, body, and footer of each page of the Microsoft Word 2010 document. If the date is not found in the header of page 5, then print date is not in the header of page 5.

推荐答案

这里有一些文章,你可以得到一些想法。



1. 如何:以编程方式搜索和替换文档中的文本 [ ^ ]

2. 通过C#搜索和突出显示MS Word中的文本 [ ^ ]
Here are some article where you can get some idea.

1. How to: Programmatically Search for and Replace Text in Documents[^]
2. Search and highlight text in MS Word through C#[^]


这篇关于C#Interop字符串搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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