ms-word

How can I replicate programmatically in VBS what Word does when I insert a “built-in” property from the Insert->QuickPart->Document Property dropdown?

元气小坏坏 提交于 2020-08-08 07:00:07
问题 In Microsoft Word (Windows desktop version from around 2007 and later), I can use the Insert Tab, Text group, Explore Quick Parts dropdown, Document Property dropdown to insert a Content Control that allows display/entry/selection of the value of one of a number of types of Document Property , which might be one of the following: Built-in document properties "Content Type" metaproperties associated with a server such as Microsoft's SharePoint server How can I do programmatic insertion of

64 bit Word VBA DEVMODE.dmDuplex returns 4

拟墨画扇 提交于 2020-08-06 05:31:12
问题 I am currently in the process of converting the VBA code from the old 32bit Office to 64bit Office. We have a printing functionality that allows the user to change the default printers setting from duplex to simplex and vice versa. I have gone though the majority of my code replacing Long with LongPTR and adding PtrSafe when declaring functions. The issue I am having is that when calling the CopyMemory function, the returned DEVMODE contains different values in 64 bit and 32 bit. See below:

Parse Word (.doc /.docx) document

*爱你&永不变心* 提交于 2020-08-05 08:19:12
问题 Is there a way/best possible solution to parse a .doc / .docx in c#/asp.net? My document look like this: (repeater) chapter(text) picture text (/repeater) It is very important that the parser readers the picture. 回答1: in the following question you can find a general word doc parsing: How to parse text from MS Word document to string and in this MSDN page you can find how to handle pictures in the document: https://msdn.microsoft.com/en-us/library/office/hh965732(v=office.14).aspx post your

VBA find word and replace with a Hyperlink in Word 2010

本秂侑毒 提交于 2020-08-02 04:59:14
问题 I've a word document with some text. At some paragraphs I've words that I want to add the hyperlink to. Here's an example: The book "When the sun goes up", ABC-1212321-DEF, have been released today....... The "ABC-1212321-DEF" should be found and apply a hyperlink as follows: http://google.com/ABC-sometext-1212321-anothertext-DEF All the strings in the document starts with "ABC-" and ends with "-DEF". Thanks in advanced. EDIT: This is what I've got this far: Sub InsertLinks() Dim r As Range

Number of pages in a word doc in java

空扰寡人 提交于 2020-08-01 09:24:56
问题 Is there an easy way to count the number of pages is a Word document either .doc or .docx? Thanks 回答1: You could try the Apache API for word Docs: http://poi.apache.org/ It as a method for getting the page count: public int getPageCount() Returns : The page count or 0 if the SummaryInformation does not contain a page count. 回答2: I found a really cool class, that count Pages for Word , Excel and PowerPoint. With help of Apache POI. And it is for old doc and new docx. String lowerFilePath =

Convert .rtf to .docx from selected folder and its subfolders in VBA

天大地大妈咪最大 提交于 2020-07-24 05:05:22
问题 I managed to modify this VBA script so that it would be able to choose a folder, convert .RTF to .DOCX, and delete the .RTF files after conversion. What I cant figure out, is; How do I get the script to also convert the subfolders in-within that folder. I have looked online and was not able to find a solution. Please advise. Sub ChangeRTFTODOCXOrTxtOrRTFOrHTML() Dim fs As Object Dim oFolder As Object Dim tFolder As Object Dim oFile As Object Dim strDocName As String Dim intPos As Integer Dim

Convert .rtf to .docx from selected folder and its subfolders in VBA

Deadly 提交于 2020-07-24 05:01:21
问题 I managed to modify this VBA script so that it would be able to choose a folder, convert .RTF to .DOCX, and delete the .RTF files after conversion. What I cant figure out, is; How do I get the script to also convert the subfolders in-within that folder. I have looked online and was not able to find a solution. Please advise. Sub ChangeRTFTODOCXOrTxtOrRTFOrHTML() Dim fs As Object Dim oFolder As Object Dim tFolder As Object Dim oFile As Object Dim strDocName As String Dim intPos As Integer Dim

Convert .rtf to .docx from selected folder and its subfolders in VBA

限于喜欢 提交于 2020-07-24 05:00:14
问题 I managed to modify this VBA script so that it would be able to choose a folder, convert .RTF to .DOCX, and delete the .RTF files after conversion. What I cant figure out, is; How do I get the script to also convert the subfolders in-within that folder. I have looked online and was not able to find a solution. Please advise. Sub ChangeRTFTODOCXOrTxtOrRTFOrHTML() Dim fs As Object Dim oFolder As Object Dim tFolder As Object Dim oFile As Object Dim strDocName As String Dim intPos As Integer Dim

Excel VBA to Open Multiple Word files in a loop

╄→гoц情女王★ 提交于 2020-07-24 04:21:39
问题 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:21:03
问题 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 =