English 中文(简体)
如何阅读。 Doc Template file and Edit Template with Values?
原标题:How to Read .Doc Template File and Edit Template with Values?

I have a document template and I want to use that template for merging client information with that (Replacing <>, <> <> with our information from database.

为此,首先需要阅读文件,更新领域,然后用标签取代数据。

Can any one please help me to visualize this; how to do this and using what tools?

Thanks, Jigar

最佳回答

I found my answer from http://docx.codeplex.com/ tool. It is really super cool tool to do modification in your document template.

Consider this - with minimal efforts to make it ready for you.

问题回答

You will have to use OpenXML technology to manipulate the word document and insert dynamic content into the word document. I assume that you are using docx word documents for this purpose. The docx file is actually a zipped file which has many xml files, which inturn can be manipulated using the OpenXML API using c#. In your case, the contents of the word will be in an xml called "document.xml". You will have to read this XML and replace the <> placeholder with your data from database. I have written 2 articles (with source code) with respect to these concepts. You can use the following links which can give a heads-up.

http://www.codeproject.com/KB/office/Word_2007_Footnote.aspx http://www.codeproject.com/KB/office/Word_2007_Images.aspx

虽然这也许不会给你解决你的具体问题的准确办法,但你可以用一些东西(例如,如何用开放式XAPML和c#读到文件xml),然后你可以自己努力解决你的问题。

EDIT:Did没有注意到你提到.doc文档。 我看到了“开放式”标签,因此作了答复。 我认为,只有在文件是.docx时才适用这一解决办法。

http://worddocgenerator.codeplex.com/“rel=“nofollow”http://worddocgenerator.codeplex.com/。 文献集器是一种有用的工具/工具,可生成 采用《2010年视听室》和《开放式XML》2.0 SDK模板提供的文件。

我认为,你重新寻找把文字文件放在邮件中。 见。 邮电和报Aspose部分。 页: 1 NET文件。

Disclosure: I work as a developer evangelist at Aspose.

Docmacy是多平台工具,可以将理论档案作为模板,并通过邮件——像程序一样使用。 违约时,它使用文件领域和平原文本“斜线”;“设计”;“实地”和“&”;





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签