ms-word

document.contentControls not returning all ContentControls in the document

不羁岁月 提交于 2021-01-29 09:21:40
问题 I have a document with three ContentControl objects that looks like this: Here is the .docx file in its entirety - but essentially the markup of the document body looks like this: <w:body> <w:p w:rsidR="0075044D" w:rsidRDefault="0075044D"> <w:r> <w:t xml:space="preserve">Video provides a powerful way to help you </w:t> </w:r> <w:sdt> <w:sdtPr> <w:alias w:val="cc1"/> <w:tag w:val="prove"/> <w:id w:val="806369342"/> <w:placeholder> <w:docPart w:val="1F3FDE3D075A4E8AADE251C4E318E379"/> </w

MS Word Mail Merge and Split Documents saving, Header and footer issue

六月ゝ 毕业季﹏ 提交于 2021-01-29 07:48:41
问题 I am using the below Macro to split the mail merged into separate documents. What I need is it to split into separate documents keeping the whole page including the header and footers and saving as in the first merged field on the page, which is the first piece of information on the merged letters. However, the macro runs only on one letter not the rest, and the format is completely incorrect. It changes the font, page layout and does not include the headers and footers. It also saves as 'Ref

Android: Opening a Word document using intents and FileProvider

只愿长相守 提交于 2021-01-29 07:29:21
问题 I am trying to open a word document (.doc and .docx) on Android from my app but I am getting a popup errors from the MS Word app: Can't open file | Try saving the file on the device and then opening it and the Google Docs app: Unable to open the document | We were unable to open your file The document is local and bundled with the app in the assets folder, and the chooser opens without catching any errors until the third party app tries to open the document. I am fairly certain there is an

Word Interop: how to insert a citation field?

夙愿已清 提交于 2021-01-29 07:12:44
问题 I have a Selection and would like to use it to insert a citation. Currently, I insert an index mark using Selection sel; : string cmd = "Lincoln, Abraham"; document.Indexes.MarkEntry(sel.Range, Entry: cmd); I'm thinking that inserting a citation would be similar, but am not seeing the equivalent of Document.InsertCitation() or Document.Bibliography.InsertCitation() ? 回答1: Try TableOfAuthorities ?? That works in VBA Document.TablesOfAuthorities.MarkCitation _ Range:=Selection.Range,

Apache POI: ${my_placeholder} is treated as three different runs

删除回忆录丶 提交于 2021-01-29 06:44:26
问题 I have a .docx template with placeholders to be filled, such as ${programming_language} , ${education} , etc. The placeholder keywords must be easily distinguished from the other plain words, hence they are enclosed with ${ } . for (XWPFTable table : doc.getTables()) { for (XWPFTableRow row : table.getRows()) { for (XWPFTableCell cell : row.getTableCells()) { for (XWPFParagraph paragraph : cell.getParagraphs()) { for (XWPFRun run : paragraph.getRuns()) { System.out.println("run text: " + run

Expose Excel InlineShapes to edit

我是研究僧i 提交于 2021-01-29 06:01:55
问题 I am trying to automatize filling in a third party form from an Excel Workbook VBA module. They sadly have gone with a Word document with an in-line Excel workbook embedded, which contains cells as named ranges that I want to edit. How do I assign the InlineShapes object to an Excel.workbook object so that I can expose it to Excel methods and properties? This is what I have tried so far: Sub test() Dim wdApp As Word.Application Set wdApp = CreateObject("word.application") wdApp.Visible = true

Adding code for extracting Headings from Word Comments into Excel

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 05:42:33
问题 I have some code for extracting Comments from Word into Excel. However, it only extracts one level of Heading (the direct heading). What code can I add to extract different Heading levels in separate columns in Excel? And can I select these different heading level by Style e.g. if I use style MyOwnHeading, the code would pick that up as the Heading. Sub ExportWordComments() ' Purpose: Search for comments in any text that's been pasted into ' this document, then export them into a new Excel

VBScript Syntax: MS Word Merge Field

我的未来我决定 提交于 2021-01-29 05:25:10
问题 I need a macro that places a conditional merge field with nested IF statements. Most users just copy the merge fields from one document and paste them into their final draft. However, there are numerous conditional merge fields to choose from. Using a command button that inputs the merge field instead of copying and pasting will illuminate user error and speed up this process. Any help is much appreciated. A macro that places a multi-nested conditional IF statement into a document. Below is

How can I format text without changing document state in MSWord web add-in API?

我怕爱的太早我们不能终老 提交于 2021-01-29 05:19:03
问题 I'm developing an add-in for MSWord using Microsoft web add-in API. I'd like to underline or highlight some given words, but only in the scope of that session. I don't want to change the document's state. In other words, I don't want to persist the new text formatting when the document is saved. I know how to format text, but the document's state is changed. I have this code at the moment: word_range.font.underline = Word.UnderlineType.wave; I want to achieve a behavior similar to Grammarly

Failure to set FSO = CreateObject with ExceltoWord! Add-in

心已入冬 提交于 2021-01-29 05:04:34
问题 I'm using the Excel Add-in ExceltoWord to auto-populate a Word Document from an Excel worksheet. I've followed the instructions from the original developer here. I'm using the "I created generic bookmark indicators, in Word" and "I put bookmark indicators directly in cells - Left" options with "Delete the Word doc" at the end. When I save settings I get an MS Visual Basic error Run-time error '429:' ActiveX component can't create object. I've tried switching different formats of Excel sheet