Microsoft Office word(doc)文件操作问题 [英] Microsoft Office word(doc) file Manipulation Problems
问题描述
我已经开发了基于asp.net的诊断应用程序,该应用程序有一个表名称 Histopath(id,gross_appearance,dx,appearance)
我有一个MS doc文件名 sample.doc .
sample.doc将在按钮事件下从UI接收4个参数(病人ID,姓名,博士姓名,联系人姓名).
此sample.doc也包含其他文本文件.
首先,我要将这4个参数保存到sample.doc中,将其复制并保存到另一个文件中,文件名将根据Patient_id.
NB 每次单击事件时都会生成新文件,我必须根据Patient_id从文件夹中搜索文件.(最好在此条件下使用XML)
任何帮助都会让我感激不尽.
Masud
Hi,
I have developed asp.net based Diagnostic Application,that I have one table Name Histopath(id,gross_appearance,dx,appearance)
I have a MS doc file name sample.doc.
sample.doc will receive 4 parameter(patient_id,name,Dr_name,contact_no)from UI under button event.
This sample.doc contain other text file also.
Firstly I want to save this 4 parameter into sample.doc,copy this data and save it another file and file name will be according patient_id.
N.Bnew file will be generate each and every time under event click and I have to search file from folder according patient_id.(Is it better to use XML in this criteria)
Any help make me grateful.
Masud
推荐答案
如果在这种情况下要使用XML,则模板文件应以xml格式(sample.xml)存储.
如果您想使用Word 2003,那么
1.根据您的模板创建XML架构
2.在您的Word文档中附加XML模式
3.使用自动单词替换xquery的架构内容
如果您想使用Word 2007,那么
1.根据您的模板创建XML架构
2.在您的Word文档中附加XML模式
3.使用Open XML SDK将架构内容替换为xquery
请参见 [生成Word报告/文档 a>]和 [
If you want to use XML in this case then your template file should be stored in xml format (sample.xml).
If you want to work with Word 2003 then
1. Create an XML Schema based on your template
2. Attach the XML Schema in your word document
3. use word automation to replace the schema content by xquery
If you want to work with Word 2007 then
1. Create an XML Schema based on your template
2. Attach the XML Schema in your word document
3. use Open XML SDK to replace the schema content by xquery
See this [Generating Word Reports / Documents] and [http://blogs.msdn.com/b/brian_jones/archive/2010/02/26/open-xml-sdk-office-services-better-together.aspx]
这篇关于Microsoft Office word(doc)文件操作问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!