# ms-word

##### How to change format of current paragraph without using Selection

I have the code below without using Selection. Sub Format paragraph() Dim wdDoc As Document With wdDoc.Range.Find .Font.Size = 12 .Text = "?" .Execute End With End Sub When the character with font size = 12 is found, how can I change the format of the current paragraph? for example: wdDoc.Paragraph(current).Font.Size = 14 wdDoc.Paragraph(current).Font.Color = wdBlue Thanks for any help.

2021-09-25 17:34:38    分类:问答    vba   ms-word

##### Replacing all occurrences of a string in a Word file by an hyperlink

I have to create a Powershell script that reads a Word file (.docx) and replaces strings by hyperlinks. So far, based on this script, I can replace all occurrences of a string by another string easily. With that script, I can look for a string and replace it by an hyperlink. However, only the first occurrence is replaced. Here's my understanding of the problem so far : The first script uses the ReplaceWith and Replace=wdReplaceAll parameters of the Execute function of the Find Interface. The issue is that ReplaceWith expects a String and not an Hyperlink object. The second script doesn't

2021-09-25 06:52:43    分类:问答    vba   powershell   ms-word

##### How to change font size of non-English words?

In a Word 2007 document, I manually select a sentence containing both English & Bengali words of multiple font size. When I enter some numeric value in Font size list-box in the panel and press Enter, the whole sentence font size is changed (including Bengali words). When I select the same sentence in a Word-VBA macro and in final line try Selection.font.Size=8 only English words' font size gets changed. I tried to loop through each character, but got the same result. I need to stick to Word-VBA as it is part of a web scraping program using Chrome web-driver Selenium. I tried a simple macro in

2021-09-24 08:17:57    分类:问答    vba   fonts   ms-word   non-english

##### 通过文字自动化服务运行后，表格文本会获得额外的间距(Table text gets extra spacing after running through word automation services)

2021-09-24 07:04:49    分类:技术分享    ms-word   sharepoint-2013   openxml   docx   word-automation-service

##### 使用 VBScript 删除 MS Word 宏(Remove MS Word macro using VBScript)

2021-09-24 06:44:25    分类:技术分享    vba   vbscript   ms-word

##### Is it possible to refresh fields of a word document with Office.js?

I have word documents with fields that display the value of custom document properties as such: { DOCPROPERTY example \* MERGEFORMAT } Whenever my custom property is modified, in order for the changes to be displayed in my document, I need to select the field(s) and right-click -> update them. I was wondering if office.js had anything that would help me automatically update fields in my document.

2021-09-24 06:14:33    分类:问答    ms-word   office-js   office-addins   word-field

##### Using a macro to create conditional formatting in Word as per Excel

I have an Excel doc that has conditional formatting that changes the background colour of a cell, dependant upon the specific [dropdown] text that is selected. E.g Yes, changes cell background to Green, No to Red, Unknown to Yellow and Not applicable to Grey. All easy stuff. I then need to mailmerge to a Word doc to populate the Word doc with the Excel table - the Word doc also has other non-excel related text. As conditional formatting of the cells does not come across, I have used the under noted code in a macro to change the background colour in Word. It runs, but seems after the first loop

2021-09-24 05:24:32    分类:问答    vba   ms-word   conditional

##### 从上一个标题获取标题编号(Get heading number from previous heading)

2021-09-24 03:54:02    分类:技术分享    vba   ms-word

##### Conditional Formatting in Microsoft Word 2016 Table Cells

I have a table and it is for a test plan I am doing for a project, there is a column at the end of the table where the 2 values in it will be Y (passed the criteria) or N (didn't pass the criteria) Is there a way in Microsoft Word to change the colour of the text on the row with the value of N at the end, this makes it easier to spot the places where it failed the criteria. I know you can do the find and replace method but I was wondering if there was a way to do this automatically so when the user enters N it changes the whole row to red and when they enter Y it changes it back to normal

2021-09-24 03:35:25    分类:问答    ms-word   ms-office   conditional-formatting

##### 测试 TOC 域代码返回的错误(test for error returned by TOC field code)

2021-09-24 02:58:08    分类:技术分享    ms-word   word-2010   fieldcodes