ms-word

Populate a word template using C# in ASP.NET MVC3

喜你入骨 提交于 2021-02-07 04:16:28
问题 I read it some post referring to Populate word documents, but I need to populate a word document (Office 2007) using C#. For example i want to have a word document with a label [NAME], use that label in C# to put my value, and do all this in a ASP.NET MVC3 controller. Any idea? 回答1: You could use the OpenXML SDK provided by Microsoft to manipulate Word documents. And here's a nice article (it's actually the third of a series of 3 articles) with a couple of examples. 回答2: You can do like this

C# Get list of opened Word documents

会有一股神秘感。 提交于 2021-02-07 03:05:26
问题 Currently, I'm using this code to get the list of MS Word opened documents: List<string> doc_list = new List<string>(); try { Microsoft.Office.Interop.Word.Application WordObj; WordObj = (Microsoft.Office.Interop.Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"); for (int i = 0; i < WordObj.Windows.Count; i++) { object idx = i + 1; Window WinObj = WordObj.Windows.get_Item(ref idx); doc_list.Add(WinObj.Document.FullName); } } catch { // No documents

Copy MathML into Word to use as equation

时光总嘲笑我的痴心妄想 提交于 2021-02-06 08:49:53
问题 I can successfully copy equations made using the insert equation tool in MS word (2013) to the clipboard in MathML format for use elsewhere. However I mainly need to import into Word. Is there a way to import MathML format equation into word to be used as equations? 回答1: Did you just tried to paste any MathML fragment copied from, for example, notepad? It worked for me. Just Copy and paste the following first into notepad and, then, copy from notepad and paste it to word: <math xmlns="http:/

Copy MathML into Word to use as equation

此生再无相见时 提交于 2021-02-06 08:49:34
问题 I can successfully copy equations made using the insert equation tool in MS word (2013) to the clipboard in MathML format for use elsewhere. However I mainly need to import into Word. Is there a way to import MathML format equation into word to be used as equations? 回答1: Did you just tried to paste any MathML fragment copied from, for example, notepad? It worked for me. Just Copy and paste the following first into notepad and, then, copy from notepad and paste it to word: <math xmlns="http:/

Reading or Converting word .doc files iOS

筅森魡賤 提交于 2021-02-05 20:29:23
问题 How are other apps on iOS able to read and write word docs? I see some other questions related to this and accepted answers are along the lines of "it can't be done." I don't want to just display a word doc, I want to read it along with its formatting. How are other apps doing it, are they writing the parsing themselves using the published standard put out by Microsoft? Are they using some kind of bundled utility to convert the file to some other format like XML or HTML before processing it?

Adding page number in word header table C#

笑着哭i 提交于 2021-02-05 08:09:05
问题 I have created a 1x3 table as my header in word. This is how I want it to look like. LeftText MiddleText PageNumber: I want the PageNumber cell to look like this - Page: X of Y I have managed to do cell (1,1) and (1,2). I found this to help me with cell (1,3) but it is not working as I like. I know how to get the total count of the document. I'm not sure how to implement it properly. Range rRange = restheaderTable.Cell(1, 3).Range; rRange.End = rRange.End - 1; oDoc.Fields.Add(rRange, Type:

Adding page number in word header table C#

心不动则不痛 提交于 2021-02-05 08:08:33
问题 I have created a 1x3 table as my header in word. This is how I want it to look like. LeftText MiddleText PageNumber: I want the PageNumber cell to look like this - Page: X of Y I have managed to do cell (1,1) and (1,2). I found this to help me with cell (1,3) but it is not working as I like. I know how to get the total count of the document. I'm not sure how to implement it properly. Range rRange = restheaderTable.Cell(1, 3).Range; rRange.End = rRange.End - 1; oDoc.Fields.Add(rRange, Type:

How to save gridview templated Item data into DB as well as generate a word document?

走远了吗. 提交于 2021-02-05 05:53:17
问题 I have few textbox which is outside of gridview and a templated item gridview, on button click which is outside of gridview. I want to save data into database table as well as generate a word document. In word doc. data will show something like this PO No: 123 Company Name: xyz Order No: 12345 Item Qty Description 1 2 test1 2 4 test2 <asp:Label ID="lblPONumber" runat="server" Text="PO Number"></asp:Label> <asp:TextBox ID="txtPONumber" runat="server"></asp:TextBox> <asp:Label ID=

What is best solution to generate Word document from ASP.NET? [closed]

泄露秘密 提交于 2021-02-04 19:02:05
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question I would like to generate a word document from my ASP.NET application. Currently we show an "Agenda List" which is the agenda information and all items/subjects. This page needs to have the ability to open in word. The agenda page is not static, it's a dynamic list

Need to expand Multiple find and replace in MS Word from a list in MS Excel to replace text w hyperlink and fix error

☆樱花仙子☆ 提交于 2021-02-04 08:26:07
问题 I have a large Word file that refers to multiple Question #s throughout. I also have an Excel file that lists all the Question #s in Column A and in Column B there is a list of actual questions that are also hyperlinks. I would like to replace every question # in the Word document with the corresponding hyperlinked question in Column B of the spreadsheet. I tried to use the macro in the StackOverflow question Multiple find and replace in MS Word from a list in MS Excel, but I get the Run-time