ms-word

Word 2010 automation: 'goto bookmark'

纵饮孤独 提交于 2020-01-03 11:02:14
问题 I have a program written in Delphi-7 which opens a new Word document which is based on a template. Once the document is open, the automation jumps to a bookmark (predefined in the template) and adds some text there. The following code works fine in Word 2003 but causes a invalid variant operation error message in Word 2010 (I have omitted try/except blocks for the sake of clarity) . wrdapp:= CreateOleObject ('Word.Application'); wrdDoc:= wrdapp.documents.add (wrdApp.Options.DefaultFilePath

Word 2010 automation: 'goto bookmark'

a 夏天 提交于 2020-01-03 11:02:10
问题 I have a program written in Delphi-7 which opens a new Word document which is based on a template. Once the document is open, the automation jumps to a bookmark (predefined in the template) and adds some text there. The following code works fine in Word 2003 but causes a invalid variant operation error message in Word 2010 (I have omitted try/except blocks for the sake of clarity) . wrdapp:= CreateOleObject ('Word.Application'); wrdDoc:= wrdapp.documents.add (wrdApp.Options.DefaultFilePath

Automatically update formula field after generating Open XML Word document

假装没事ソ 提交于 2020-01-03 10:41:15
问题 I have a library that generates Word documents using the OpenXML SDK, one of the functionalities of the library is the generation of tables with formulas on the last row (such as SUM(ABOVE) ). Word has these functions built-in, but when generating the document I have to assume that Word isn't installed on the machine. The problem is that if I just generate the table and the formula field, it won't be updated automatically when the document is opened, the user would have to open the document

Loop over PDF files and transform them into doc with word

本小妞迷上赌 提交于 2020-01-03 08:40:08
问题 I am trying to use VBA coding - which I am pretty new to - to obtain a series of .doc documents from PDFs (which are not images), that is, I am trying to loop over various PDF files and save them in MS Word format. My experience is that word reads pretty well the PDF documents that I have: word maintains the correct layout of the PDF file most of the time. I am not sure if this is the right choice to tackle this and I ask for an alternative suggestion -- using R, if possible. Anyway, here it

Regex for MS Word for detecting subtitle

不打扰是莪最后的温柔 提交于 2020-01-03 07:02:48
问题 I have a MS Word Documents with its subtitle all in font-size 18px and bold. I want to find them all and replace them with something else. There I use Ctrl+H, enabling wldcards, chossing the font style (fontsize and bold), and use the regex (*{1,}) . However, this regex would find occurrences for every single character. How can I make every whole subtitle as a single occurence? Thanks 回答1: Use a Word wildcard Find/Replace, where: Find = ([!^13]@)^13 Replace = Before Text \1 After text^p and

Microsoft Word 2013 macro save file name from form content

我只是一个虾纸丫 提交于 2020-01-03 06:01:07
问题 I'm trying to write a macro that will save a Microsoft Word 2013 document with a specific filename. I have created a word form that a client fills out. I would like to create a macro that automatically saves the document with the name of one of the fields that the client fills out in the form. Example: below are fillable content fields. client reference: A1B2-345 date: August 17, 2015 type: metadata I would like to save the file as: A1B2-345_17082015_metadata.DOCX I'm fairly new to

Manipulating content in Microsoft Word with VBScript or VBA

醉酒当歌 提交于 2020-01-03 05:34:06
问题 I've come here for plenty of advice on how to develop VBScript and VBA applications using Excel, but now I've been faced with a new challenge: develop a VBScript/VBA application for Word. I know, in Excel, if I wanted to type "my name" in cell B3, I would type this: Range("B3").Value = "my name" I need to be able to locate where a name and address for a formal letter would be entered, as well as today's date, and my initials as a signature. I thought I might be able to find VBScript/VBA

How to delete Text between start and end vba word

淺唱寂寞╮ 提交于 2020-01-03 05:26:10
问题 How can one go about deleting text between a start word and an end word. I have a huge text extract of about 1 million plus words and I want create a VBA Script which will delete all the unwanted text. Fortunately I have the key words to look for and delete all the text after those key words up to a specific end point which I would like to enter. I need a program that can find these key words and dedicate them as the start words and then an end word as the end position and to delete all the

Save export from range in excel to Word and save as name in Cell A1

独自空忆成欢 提交于 2020-01-03 04:25:15
问题 I am now exporting a range of cells into Word using a macro in excel. There are some changes though as I need it to instead copy this to a NEW Word document and not an existing one that is in the script? My range that is selected is made up of various Vlookup results. Also, if possible, I want to get the file name to be whatever is in A1. Sub Export_Table_Data_Word() 'Name of the existing Word document Const stWordDocument As String = "Table Report.docx" 'Word objects. Dim wdApp As Word

Creating Word or XML document with VBA

北城以北 提交于 2020-01-03 03:50:20
问题 I need to create documents, (~150 reports, letters) mostly from pre-existing snippets and local databases, with VBA, in Word 2003. I then need to change specific parts of those snippets, such as dates, phrases, user information, &c. There are also, obviously, some bits that I will generate in my program. Currently, this same task is done (sort of) by some hideous legacy VBA. (Nested IFs and FORs, and over 200 textboxes all called TextBox#) It gets the job done SOMETIMES, and does so by