ms-word

Excel VBA to Open Multiple Word files in a loop

谁都会走 提交于 2020-07-24 04:19:47
问题 I apologize in advance for the newbie question -- most of my VBA experience is in Excel, or Word to Excel. In this case, I am going from Excel to Word. I am trying to capture some data off of some Word forms and store it in an Excel file. Right now, my code works for the first document in the folder, but after that, it hoses up with an automation error "the server threw an exception" (goo!) Here is my code: Dim objWordApp As Object strCurFileName = Dir(strFilePath) Set objWordApp =

Excel VBA to Open Multiple Word files in a loop

南笙酒味 提交于 2020-07-24 04:19:20
问题 I apologize in advance for the newbie question -- most of my VBA experience is in Excel, or Word to Excel. In this case, I am going from Excel to Word. I am trying to capture some data off of some Word forms and store it in an Excel file. Right now, my code works for the first document in the folder, but after that, it hoses up with an automation error "the server threw an exception" (goo!) Here is my code: Dim objWordApp As Object strCurFileName = Dir(strFilePath) Set objWordApp =

Apache POI - convert word to pdf

不打扰是莪最后的温柔 提交于 2020-07-22 22:11:03
问题 I am trying to convert XWPFDocument to PDF but getting an error. I am using - https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.poi.xwpf.converter.pdf/2.0.1. <!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport /fr.opensagres.poi.xwpf.converter.pdf --> <dependency> <groupId>fr.opensagres.xdocreport</groupId> <artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId> <version>2.0.1</version> </dependency> Code: FileInputStream fis = new FileInputStream("1

Apache POI - convert word to pdf

不羁岁月 提交于 2020-07-22 22:10:26
问题 I am trying to convert XWPFDocument to PDF but getting an error. I am using - https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.poi.xwpf.converter.pdf/2.0.1. <!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport /fr.opensagres.poi.xwpf.converter.pdf --> <dependency> <groupId>fr.opensagres.xdocreport</groupId> <artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId> <version>2.0.1</version> </dependency> Code: FileInputStream fis = new FileInputStream("1

Highlight list words in a MS Word file

眉间皱痕 提交于 2020-07-22 21:36:15
问题 First I want to say that I don't know anything about VBA and I want to highlight list words which is in A.txt(or .doc) file to a MS-Word file B.docx that full of texts. I found a VBA code that works perfectly fine but It needs you put words into the code StrFnd = "dog,cat,pig,horse,man" . Can you help me change it somehow the code gets list words file A.txt instead of typing these words. Thank you very much. Sub HiLightList() Application.ScreenUpdating = False Dim StrFnd As String, Rng As

Highlight list words in a MS Word file

白昼怎懂夜的黑 提交于 2020-07-22 21:34:41
问题 First I want to say that I don't know anything about VBA and I want to highlight list words which is in A.txt(or .doc) file to a MS-Word file B.docx that full of texts. I found a VBA code that works perfectly fine but It needs you put words into the code StrFnd = "dog,cat,pig,horse,man" . Can you help me change it somehow the code gets list words file A.txt instead of typing these words. Thank you very much. Sub HiLightList() Application.ScreenUpdating = False Dim StrFnd As String, Rng As

String too long, copying data from Excel into a Word Document

社会主义新天地 提交于 2020-07-18 08:24:13
问题 I'm trying to replace a placeholder in a text document with a string from an Excel cell. It works fine for strings less than 255 characters but not when they are greater. Code: Sub Sheet003ADes() 'Sheet 3A- Multi-Family Housing ----------------------------- With Selection.Find .ClearFormatting .Text = "[[3A DESCRIPTION]]" .Replacement.ClearFormatting .Replacement.Text = Worksheets("3A- Multi-Family Housing").Range("A4").Value 'Insert 3A Activity Description .Execute Replace:=wdReplaceAll,

Using word vba to format parts of table cell text

瘦欲@ 提交于 2020-07-11 03:36:14
问题 I'm using the following code to combine text from two excel cells into a word table cell. I want to format the first part (captionStr) as bold but can't seem to figure out how to specify just that part of the range. I tried .Range(0,Len(captionStr)).Font.Bold=True and .Range.Characters(0,Len(captionStr)).Font.Bold=True but both give me "wrong number of argument" errors. I'm using Office 2010 with MS Word 14.0 Object Reference With tbl.Cell(nRow, 2).Range .Style = rfpDoc.Styles(wdStyleNormal)

Review Pane Opens Whenever I run a Macro in Word

有些话、适合烂在心里 提交于 2020-07-10 17:28:08
问题 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:28:07
问题 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