ms-word

Word Macro for other tray printing

自闭症网瘾萝莉.ら 提交于 2020-07-09 11:34:07
问题 For years our office has been using HP printers and a few Macros in MS Word that add buttons to the toolbar. One prints the job to tray 3 (plain paper), one prints the first page to tray 2 (pre-printed letterhead) and the rest to tray 3, and the last sends the whole job to tray 1 (manual feed for labels etc.). This has all been pretty straight cut to tweak if the printer changed, but now we have replaced all of those HP printers with Canon printers and are using the UFRII drivers... The macro

How do I add a bookmark within the body of a Word doc using Office JS

我与影子孤独终老i 提交于 2020-07-08 05:53:10
问题 The Office JS has provided the following function in preview, but I couldn't find any example. Here is what I tried but it doesn't seem to work, any idea what I am missing here, since this code inserts the text but the bookmark is not created. Word.run(function (context) { let range = context.document.getSelection(); return context.sync().then(function () { range.insertText(`Test Bookmark`, Word.InsertLocation.replace); let uniqueStr = new Date().getTime(); let bookmarkName = `Test

How do I add a bookmark within the body of a Word doc using Office JS

喜欢而已 提交于 2020-07-08 05:53:09
问题 The Office JS has provided the following function in preview, but I couldn't find any example. Here is what I tried but it doesn't seem to work, any idea what I am missing here, since this code inserts the text but the bookmark is not created. Word.run(function (context) { let range = context.document.getSelection(); return context.sync().then(function () { range.insertText(`Test Bookmark`, Word.InsertLocation.replace); let uniqueStr = new Date().getTime(); let bookmarkName = `Test

I'm not able to get the selected value from ContentControl and I'm not able also to set the value I want

北城以北 提交于 2020-07-07 13:11:33
问题 I'm trying to make a dependent drop-down list where the user may select the first drop-down list and all the other dependent drop-down list will change automatically. Select Case ContentControl.Title Case "T1_1" Select Case ContentControl.DropdownListEntries.Item.Value Case "male" ActiveDocument.SelectContentControlsByTitle("T1_2").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_3").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_4").Item(1).Value

I'm not able to get the selected value from ContentControl and I'm not able also to set the value I want

柔情痞子 提交于 2020-07-07 13:05:49
问题 I'm trying to make a dependent drop-down list where the user may select the first drop-down list and all the other dependent drop-down list will change automatically. Select Case ContentControl.Title Case "T1_1" Select Case ContentControl.DropdownListEntries.Item.Value Case "male" ActiveDocument.SelectContentControlsByTitle("T1_2").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_3").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_4").Item(1).Value

I'm not able to get the selected value from ContentControl and I'm not able also to set the value I want

痴心易碎 提交于 2020-07-07 13:05:07
问题 I'm trying to make a dependent drop-down list where the user may select the first drop-down list and all the other dependent drop-down list will change automatically. Select Case ContentControl.Title Case "T1_1" Select Case ContentControl.DropdownListEntries.Item.Value Case "male" ActiveDocument.SelectContentControlsByTitle("T1_2").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_3").Item(1).Value = "male" ActiveDocument.SelectContentControlsByTitle("T1_4").Item(1).Value

Word style is changed after applying ApplyListTemplate

五迷三道 提交于 2020-07-07 09:13:50
问题 I have a Word document containing a numbered list like this Item 1 Item 2 Item 3 The list style is "List Paragraph". Left indent of "List Paragraph" is 0.5". If we run the following code to reapply the style "List Paragraph", the left indent of the style is now 0.75" Dim t As ListTemplate Set t = ActiveDocument.Styles("List Paragraph").ListTemplate t.ListLevels(1).ResetOnHigher = True Selection.Range.ListFormat.ApplyListTemplate t, False, wdListApplyToWholeList As a result, the list is

Opening a Word file

情到浓时终转凉″ 提交于 2020-07-03 17:33:05
问题 I would like to open my Word file (to make the changes then save it under different name). I can't open my file. My first code: Sub RamsOpen2() Dim Doc Dim DocPath Dim DocObj Dim VarResult DocPath = "C:\Users\mariuszk\Desktop\cf10\RAMS.docx" Set DocObj = CreateObject("word.Application") Doc = DocObj.Documents.Open(DocPath) DocObj.Visible = True With Doc.ActiveDocument Set myRange = .Content With myRange.Find .Execute FindText:="FindText", ReplaceWith:="ReplaceText", Replace:=2 End With End

Unable to read all content in order of a word document (docx) in Apache POI

被刻印的时光 ゝ 提交于 2020-07-02 02:55:07
问题 I've been trying to read all content (including tables, pictures, paragraphs) from a word document. I'm able to read tables and paragraphs using getBodyElementsIterator() but it doesn't read pictures present inside the document. Although I'm able to read pictures seperately using getAllPictures() but I need to read everything in order. I've tried looking for XWPFPicture instance while looping inside getBodyElementsIterator() but I'm not able to find any image instance. Iterator<IBodyElement>

Unable to read all content in order of a word document (docx) in Apache POI

白昼怎懂夜的黑 提交于 2020-07-02 02:51:32
问题 I've been trying to read all content (including tables, pictures, paragraphs) from a word document. I'm able to read tables and paragraphs using getBodyElementsIterator() but it doesn't read pictures present inside the document. Although I'm able to read pictures seperately using getAllPictures() but I need to read everything in order. I've tried looking for XWPFPicture instance while looping inside getBodyElementsIterator() but I'm not able to find any image instance. Iterator<IBodyElement>