ms-word

set/unset checkbox value with docx4j in MS Word document

浪尽此生 提交于 2019-12-24 21:06:48
问题 I'm trying to set/unset checkbox value with docx4j in MS Word document. Using code from this post: docx4j checking checkboxes I received following XML of this element from my document: <w:fldChar w:fldCharType="begin" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:ns21="urn:schemas-microsoft-com:office:powerpoint" xmlns:ns23="http://schemas.microsoft.com/office/2006/coverPageProps" xmlns:dsp="http:/

Alternatives to Search and Replace to use for telling to an application where to put content in a Word document

懵懂的女人 提交于 2019-12-24 20:27:04
问题 I write an application that does also document management. I do this in Delphi but the question may apply to c# too. I just got a very useful reply to this question I asked that made ma Search&Replace work easier. One requirement I have is automatically insert some data in the document according to the db data every time the user opens a document. Up to now (and this includes the subject of the question mentioned above) I was doing this just once: "create document from template" = substitute

Word | VBA - How to start Word in Outline view - opened exactly where you left off?

情到浓时终转凉″ 提交于 2019-12-24 20:01:21
问题 In MsWord, even though the last location of the cursor is saved automatically, that you could recall by Shift+F5 upon re-opening a document, - You can neither set it to start in Outline view. - Nor use that or any other bookmark on a collapsed Outline view to jump on. Bookmark locations for a collapsed outline are invisible. The closest option one can achieve is to open all levels of the outline and Then jump on the bookmark. For the several hundred page scientific documents we use daily that

Store multiple selections in Array and later do select all the selections in the Array

て烟熏妆下的殇ゞ 提交于 2019-12-24 19:53:04
问题 I am trying to find a word and save the selection in an array and then find again and then save the next selection in the array. And in the end try to select all the selections in the array. I am trying this but its with half knowledge. I am not able to get it. Can some one help. Sub Macro6() ' ' Macro6 Macro ' ' Selection.HomeKey Unit:=wdStory Dim selecttest(2) As Selection For I = 1 To 2 Selection.Find.ClearFormatting With Selection.Find .Text = "PQXY" .Replacement.Text = "" .Forward = True

Copy only certain pages from word doc into excel using VBA

喜夏-厌秋 提交于 2019-12-24 19:43:17
问题 1) I open a pdf using Microsoft word, through excel VBA. 2) From the word doc, I wish to copy only page 3 and page 4 (these two are tables without captions) into excel 3) at the moment, I could only copy the entire word doc into the excel, which can be troublesome. below is my code: Sub convertpdftowordthenexcel() Dim wordapp As Word.Application Dim input1 As String input1 = "C:\Users\Me\Desktop\Fruitjuice.pdf" 'open pdf in word Set wordapp = New Word.Application wordapp.documents.Open

How to accept revisions / track changes (ins/del) in a docx?

Deadly 提交于 2019-12-24 19:17:10
问题 In MS-Word 2010 there is an Option under File -> Information to check the document for problems before sharing it. This makes it possible to handle track changes (to new newest version) and remove all comments and annotations from the document at once. Is this possibility available in docx4j as well or do I need to investiagte the corresponding JAXB-Objects and write a traverse finder? Doing that manually could be a lot of work since I would have to add the RunIns ( w:ins ) to the R ( w:r )

Can't remove borders from tables in Word export

◇◆丶佛笑我妖孽 提交于 2019-12-24 18:31:45
问题 I'm having an issue when I export my html page to Word, I can't get rid of the borders on a table element. <table cellspacing="0" cellpadding="0"> <tr> <td class="title">Analyst</td> <td> <asp:Label ID="lblAnalyst" runat="server" CssClass="data" /> </td> <td class="title">Borrower</td> <td> <asp:Label ID="lblBorrower" runat="server" /> </td> </tr> </table> I set the content type to Word Response.ContentType = "application/vnd.ms-word"; Response.AddHeader("content-disposition", String.Concat(

Embedding word document in web form

自古美人都是妖i 提交于 2019-12-24 18:27:48
问题 I have a requirement to display word document in ASP.NET form. Also, the original word format has to be retained. In a nutshell i have to embed a word document in a web form programatically. Can someone please help. 回答1: If all the clients that are browsing the site are going to have Word installed and use Internet Explorer, you could embed it with an ActiveX object. If these requirements are not met you might need to convert it to some more standard format that a browser is capable of

Visual basic macro- changing the colour of specific text

烈酒焚心 提交于 2019-12-24 18:19:04
问题 Im very new to visual basic and macros. what i have been trying to do is create a macro that will look through the whole document and check to see if any of the font is red;if it is red then i want to change the red font to a white font. I know my code is wrong but can anyone tell me what i am doing wrong? Sub red() If Font.Color =wdColorRed Then Font.Color = -603914241 End Sub 回答1: You can use the following which is fairly quick (no looping required for each sheet). Sub Macro1() Application

Opening Word Document using VBA in Access 2013

自闭症网瘾萝莉.ら 提交于 2019-12-24 18:08:03
问题 I'm using Access 2013 and created a help button on a form that I would like to open up a Word doc with instructions. Here's the code I tried: Private Sub cmdHelp_Click() Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Dim filepath As String Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True filepath = "C:\...\Handout.docx" Set wrdDoc = wrdApp.Documents.Open(filepath) End Sub The problem is, when I try to compile I get an error on the first line that says "User