C#代码,用于将多个word文档合并为1个word文档,文档名称为Index [英] C# code for merging multiple word documents into 1 word document with document name as Index

查看:56
本文介绍了C#代码,用于将多个word文档合并为1个word文档,文档名称为Index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求 - aprox 20个单词文档,应将其转换为单个文档,文档名称为标题。在输出文档中,如果有人点击索引,它应该导航到该特定文档。

Requirement- aprox 20 word documents which should be converted as a single document with document name as heading. In the output document if anyone clicks on index it should navigate to that specific document.

推荐答案

你提到你正在使用iTextSharp来合并文档,但是如何你有没有设法做到这一点?

iTextSharp只能合并PDF文件,而不能合并Word文件。



您是否要求将多个Word文档合并为一个PDF文档?

然而问题仍然存在,您究竟是如何合并这些Word文档的?

如果你我可以提供这些信息,然后我将向您展示如何在每个合并文档的开头创建书签,以及如何创建超链接,单击该链接将跳转到所需的书签位置。您还可以在这些书签中放置与文档名称相同的文本内容。



另外,正如您所考虑的那样,您考虑创建TOC(目录表)元素并且在每个合并文档的开头放置一个带有文档名称文本的标题1段落?

我不确定这是否符合您的需求,因为其他文档内容可能会弄乱TOC的条目。
You mentioned that you're using the iTextSharp to merge the documents, but how did you manage to do that?
The iTextSharp is capable of merging only the PDF files, not Word files.

Is your requirement to merge multiple Word documents into a single PDF document?
Nevertheless the question still remains, how exactly are you merging those Word documents?
If you can provide that information then I'll show you how you can create bookmarks at the start of each merged document and how you can create a hyperlink that when clicked will jump to the required bookmark's place. You would also place a text content equal to the document's name in those bookmarks.

Also just as an FYI did you consider creating a TOC (Table of Content) element and placing a "Heading 1" paragraph with a document's name text at the beginning of each merged document?
I'm not sure if this would suite your needs because the other documents content could mess up the TOC's entries.


它不是那样的工作。

我们不为你工作。

如果你想要某人要写你的代码,你必须付钱 - 我建议你去Freelancer.com并在那里问。



但要注意:你得到你付出的代价。支付花生,买猴子。
It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys.


这篇关于C#代码,用于将多个word文档合并为1个word文档,文档名称为Index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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