ms-word

Review Pane Opens Whenever I run a Macro in Word

别等时光非礼了梦想. 提交于 2020-07-10 17:27:22
问题 When I run Word macros I've created (which are in the form of comments within a comment bubble), the reviewing pane keeps opening on me. I teach, and review student work in the form of Word docs. So, to give feedback, I have a lot of comments I give repetitively, so having a set of "common comments" macros is helpful to me. I can create the macros, no problem, BUT every time I run one, the reviewing pane opens, too. I don't want that to happen. Is there any way to make it stop? 回答1: You can

Review Pane Opens Whenever I run a Macro in Word

蹲街弑〆低调 提交于 2020-07-10 17:26:36
问题 When I run Word macros I've created (which are in the form of comments within a comment bubble), the reviewing pane keeps opening on me. I teach, and review student work in the form of Word docs. So, to give feedback, I have a lot of comments I give repetitively, so having a set of "common comments" macros is helpful to me. I can create the macros, no problem, BUT every time I run one, the reviewing pane opens, too. I don't want that to happen. Is there any way to make it stop? 回答1: You can

Is PHPWord suitable for direct mail?

不羁岁月 提交于 2020-07-10 08:56:31
问题 Is PHPWord suitable for direct mail? (also named Mail Merge in MS Office Word) Here is the process I want to automat: .docx documents are provided to the application. They are formatted for direct mail with fixed parts and a collection of merge fields. For each document, the application will search for the data in several databases, then create the custom documents. 回答1: found this http://phpword.readthedocs.io/en/latest/templates-processing.html Efficient but does not use native word merge

Run-Time Error '462'

送分小仙女□ 提交于 2020-07-10 04:05:32
问题 I am trying to run a macro from excel that will open up an existing word document, populate the fields from excel to word via content controls, and paste/format a table into the word document at a certain location. About 20% of the time, I'll get this Run Time Error 462 stating "The remote Server Machine Does Not Exist or is Unavailable". I will provide the code and the section where is usually gets stuck at as everything after works 100% of the time. Please help on this. Public Sub Agreement

Writing word documents with the officer package: How to combine several rdocx objects?

落爺英雄遲暮 提交于 2020-07-10 03:25:12
问题 I have several rdocx data objects created with the officer package in R. I want to combine these rdocx objects into only one rdocx object. Consider the following example: library("officer") # Create two rdocx data objects doc1 <- read_docx() doc1 <- doc1 %>% body_add_par("doc1_aaa", style = "Normal") %>% body_add_par("doc1_bbb", style = "Normal") %>% body_add_par("doc1_ccc", style = "Normal") doc2 <- read_docx() doc2 <- doc2 %>% body_add_par("doc2_aaa", style = "Normal") %>% body_add_par(

Is there any method or macro to remove all content controls in MS Word?

 ̄綄美尐妖づ 提交于 2020-07-10 00:59:51
问题 I need to remove all content controllers (Loked and unlocked) in active document without removing any text. I've search and found a macro for this. But I think it's not work properly. Word VBA to delete Content Controls with specific Tags Is it possible to do this? Edited: I've tried below code. It'll remove content controllers with text content. I need to remove only content controllers. Sub Test() Dim objCC As ContentControl Do While ActiveDocument.ContentControls.Count > 0 For Each objCC

Is there any method or macro to remove all content controls in MS Word?

允我心安 提交于 2020-07-10 00:59:48
问题 I need to remove all content controllers (Loked and unlocked) in active document without removing any text. I've search and found a macro for this. But I think it's not work properly. Word VBA to delete Content Controls with specific Tags Is it possible to do this? Edited: I've tried below code. It'll remove content controllers with text content. I need to remove only content controllers. Sub Test() Dim objCC As ContentControl Do While ActiveDocument.ContentControls.Count > 0 For Each objCC

How delete the last page in vba word

微笑、不失礼 提交于 2020-07-09 15:58:27
问题 I have a word file with table object. In my script I copy and paste many times and as a result pages are added. Copy and paste: Dim Range2 As Range Dim r i_TableAsRange.Copy Set Range2 = ActiveDocument.Content Range2.Collapse Direction:=wdCollapseEnd Range2.Paste I want to delete all pages after the second page. How can I do that? 回答1: Adapted from Marvin_Guo's post here Sub DeleteAfterPageTwo() Dim rng As Range Dim pageCount As Integer ' work out how many pages pageCount = ActiveDocument

How to remove a border from an inline shape

回眸只為那壹抹淺笑 提交于 2020-07-09 14:39:08
问题 I am working in VBA on Word 2010. I have some code to add borders to an inlineshape which is working ok, but I need to be able to remove the border and that doesn't seem to be working. I've searched through this site and can't find anything close apart from this: Mimic word borders and shading option "apply to:" (text) with vba on an inline shape Code is a follows: Sub TestAddBorders() Dim rngShape As InlineShape For Each rngShape In ActiveDocument.InlineShapes With rngShape.Range.Borders

How to work with the Next Paragraph on Word VBA

半腔热情 提交于 2020-07-09 12:01:11
问题 I'm trying to execute an action based on the next paragraph value with the following If ActiveDocument.Paragraph.Next(wdParagraph).Range.Characters.Count > 1 Then However, I think I'm not using the .Next correctly. How can I use it whithin that line of code? 回答1: The Next method doesn't appear to be available in all versions of Word VBA. According to this site it is specific to Office 365. https://msdn.microsoft.com/en-us/vba/word-vba/articles/paragraph-next-method-word However, you are also