ms-word

VBA Early vs Late binding - real life performance differences

爱⌒轻易说出口 提交于 2019-12-24 07:18:06
问题 I'm writing a robust Word macro that will be used on wide range of Words on several different machines. I have red on many expert VBA forums, that early binding is always preferred to late binding, as being far superior in performance, etc. For my logic it feels so however -unless benefits are proven convincingly-, that the exact opposite applies in terms of usability, because i don't want the pain of assuring those lib-references ticked on all machines it might run on. I have experimented

How to delete an inserted OOXML comment using Word JS API?

核能气质少年 提交于 2019-12-24 07:15:01
问题 I am trying to insert comments inside word document using insertOoxml method. The comment gets inserted successfully. I want to delete this manually-inserted comment based on one of the user's actions. For example, when they switch from one feature of my add-in to another. I am trying to delete the comment parts from the Ooxml string using regex match and replace for this to work. Word.run(async(context) => { let body = context.document.body let bodyOOXML = body.getOoxml() await context.sync(

COMAddIns how to turn them on/off programmatically in Office Word 2003

纵饮孤独 提交于 2019-12-24 06:42:36
问题 I need to be able to turn off a COM add-in in Office Word 2003 but still keep it in the COMAddIn list (just not enabled). I have found the COMAddIn.Connect flag and I set it to false to try and turn if off but it seems to completely remove it from Office Word and I have to re-install the program to get it back again (seems to turn off the registry keys). So My question is how do you turn off an Office Word 2003 COMAddIn without completely removing it from Word itself? Also note that I'm using

Automating Outlook and Word to create email message

房东的猫 提交于 2019-12-24 06:37:21
问题 I'm trying to create a Word email message that will be used as the body for an Outlook message. I've been looking at sample code from Microsoft here but this code falls over when trying to create the new word document at the wordApp.Documents.Add line: Word.Application wordApp = new Word.Application(); object template = System.Reflection.Missing.Value; object newTemplate = System.Reflection.Missing.Value; object documentType = Word.WdNewDocumentType.wdNewEmailMessage; object visible = false;

Search for keywords in Word documents and index them

安稳与你 提交于 2019-12-24 06:35:24
问题 I'm looking for a way to search in Word documents and show a result of documents that matched the search criteria. I'll try to describe the scenario in more detail here. On a Windows system i have a bunch of folders. Each folder has alot of Word documents. Now i need an application that can search inside a specific folder for keywords that might occure in those word documents. Something like the FULLTEXT search that MySQL has. So if i search for the following keywords: microsoft, windows XP

How to convert doc to docx using Tika or POI?

折月煮酒 提交于 2019-12-24 05:06:07
问题 Can Anyone help me to convert a .doc file to .docx using apache Tika or with apache POI? I tried a lot of ways but stuck in converting the document to docx format. Help is appreciated. Thanks and Regards, Arun R S 回答1: I am doing this recently. And I use aspose words to convert .doc to .docx . Very convenience. Document doc = new Document(filePath); doc.save(descFilePath); Just two lines. 来源: https://stackoverflow.com/questions/23886205/how-to-convert-doc-to-docx-using-tika-or-poi

VBA Writing to Word, changing font formatting

青春壹個敷衍的年華 提交于 2019-12-24 04:42:28
问题 I'm writing a VBA script in Excel to output text based on some tables to a Word document. For the most part everything is working out beautifully (I'm teaching myself as I go with lots of help from stackoverflow). I've got a rather long code so copying it all here would be difficult, I'm going to try and show the pertinent parts. The issue I'm running into is in trying to change the formatting of my font as I go through. I've created a few different Styles to assist in standardizing the

Knitr Spin and Rmarkdown Fig.cap (figure caption). Producing double numbering pdf document

时光怂恿深爱的人放手 提交于 2019-12-24 04:29:09
问题 I am referring to this Suppress automatic figure numbering in pdf output with r markdown/knitr which I don't think was answered fully. Essentially, I am using knitr::spin and rmarkdown to produce word, pdf and html documents. For word, there appears to be no numbering when one puts in +fig.1, fig.cap = "Figure name" You only get an output Figure name in the caption. To solve that, I used captioner class. figs = captioner("Figure") That works fine for word But I am not faced with rewriting the

Read a Word Document Using c#

五迷三道 提交于 2019-12-24 04:09:19
问题 I need to start reading a word document from a specific point. That key word is taken from a dropdown combo box. The keyword is something like [blah blah, blah, 001] So, I need to read only the content from that keyword to next heading ... I used this to read heading numbers and line by line but heading num notworking string headNum = objparagraph.Range.ListFormat.ListString; string sLine = objparagraph.Range.Text; 回答1: Word.Application word = new Word.Application(); Word.Document doc = new

Printing a MS Word file from cmd

梦想的初衷 提交于 2019-12-24 03:54:05
问题 Is there any way to print a .doc or .rtf file from the Windows command line silently? I am working on a receipt printing application and I would like to perform a silent automatic print using a cmd command. 回答1: Wordpad can open rtf, doc and docx files, so you don't even need word. Then you can use wordpad's command line switch to print to the default printer. start wordpad.exe /p "path\filename.ext" 回答2: Shell is an accepted Windows terminolgy and refers to the graphical user interface. It