ms-word

Password protect Open XML Wordprocessing Document

与世无争的帅哥 提交于 2021-02-07 19:56:27
问题 I need to add basic password protection to an Open XML Wordprocessing document. I can either use the COM interface, which is very slow when I have a large number of documents to process; or I can put the data directly in the docx file under <w:settings> <w:documentProtection> which is very fast. However, looking at the requirements to encrypt the password looks like it will take hours of programming. Does anyone have this algorithm already coded? I'm coding in C#. 回答1: here's a full code

Password protect Open XML Wordprocessing Document

余生颓废 提交于 2021-02-07 19:56:11
问题 I need to add basic password protection to an Open XML Wordprocessing document. I can either use the COM interface, which is very slow when I have a large number of documents to process; or I can put the data directly in the docx file under <w:settings> <w:documentProtection> which is very fast. However, looking at the requirements to encrypt the password looks like it will take hours of programming. Does anyone have this algorithm already coded? I'm coding in C#. 回答1: here's a full code

How to replace text with a MS Word web add-in by preserving the formatting?

╄→尐↘猪︶ㄣ 提交于 2021-02-07 19:13:48
问题 I'm working on a simple grammar correction web add-in for MS Word. Basically, I want to get the selected text, make minimal changes and update the document with the corrected text. Currently, if I use 'text' as the coercion type, I lose formatting. If there is a table or image in the selected text, they are also gone! As I understand from the investigation I've been doing so far, openxml is the way to go. But I couldn't find any useful example on the web. How can I manipulate text by

How to replace text with a MS Word web add-in by preserving the formatting?

你说的曾经没有我的故事 提交于 2021-02-07 19:09:47
问题 I'm working on a simple grammar correction web add-in for MS Word. Basically, I want to get the selected text, make minimal changes and update the document with the corrected text. Currently, if I use 'text' as the coercion type, I lose formatting. If there is a table or image in the selected text, they are also gone! As I understand from the investigation I've been doing so far, openxml is the way to go. But I couldn't find any useful example on the web. How can I manipulate text by

How to Add a Menu Item in Microsoft Office Word

╄→гoц情女王★ 提交于 2021-02-07 13:21:12
问题 I tried to create a right-click menu item in Microsoft Word based on this post. Here is my code: private void ThisAddIn_Startup(object sender, System.EventArgs e) { try { eventHandler = new _CommandBarButtonEvents_ClickEventHandler(MyButton_Click); Word.Application applicationObject = Globals.ThisAddIn.Application as Word.Application; applicationObject.WindowBeforeRightClick += new Microsoft.Office.Interop.Word.ApplicationEvents4_WindowBeforeRightClickEventHandler(App_WindowBeforeRightClick);

Powershell script run from task scheduler unable to open word document

那年仲夏 提交于 2021-02-07 10:35:21
问题 I am trying to use a powershell script to get the wordcount from a number of word files and then output that to a csv file. This works as expected when run from the powershell prompt, and works when called from the cmd prompt directly or from inside a perl script, however the script fails to work when called as a scheduled task. This is not an ExecutionPolicy issue causing the script to not run at all. The script is running and produces some output, but when launched from task scheduler it is

Using VBA for word to select text and make it bold

好久不见. 提交于 2021-02-07 09:39:36
问题 I make a several page word document every week. I copy text from a PDF and paste it into a word document, I then format the text that I pasted. This takes a long time and i would like to automate it. I need a macro or some code to select specific text, then make that text bold. The specific text i need to bold is what i call a scrap code. There are 60 different codes. For example "FIPS", or "LILL". 回答1: Something like this: Sub A() ' ' a Macro ' ' Dim A(3) As String A(1) = "code1" A(2) =

Using VBA for word to select text and make it bold

冷暖自知 提交于 2021-02-07 09:39:31
问题 I make a several page word document every week. I copy text from a PDF and paste it into a word document, I then format the text that I pasted. This takes a long time and i would like to automate it. I need a macro or some code to select specific text, then make that text bold. The specific text i need to bold is what i call a scrap code. There are 60 different codes. For example "FIPS", or "LILL". 回答1: Something like this: Sub A() ' ' a Macro ' ' Dim A(3) As String A(1) = "code1" A(2) =

Is that possible to write to a word file from a C language function?

廉价感情. 提交于 2021-02-07 09:25:44
问题 I have a Library management system written in C language which has I/O file in .dat . How is it possible to get output of word file from this function: void viewbooks(void) //show the list of book persists in library { int i=0,j; system("cls"); gotoxy(1,1); printf("*********************************Book List*****************************"); gotoxy(2,2); printf(" CATEGORY ID BOOK NAME AUTHOR QTY PRICE RackNo "); j=4; fp=fopen("Bibek.dat","rb"); //the .dat file getting data to be showed while

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

老子叫甜甜 提交于 2021-02-07 04:17:08
问题 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