Questions tagged [ms-word]

Microsoft Word is a commercial word processor designed by Microsoft.

Filter by
Sorted by
Tagged with
3
votes
1answer
90 views

How to efficiently loop through paragraphs and make simple changes with Word VBA (Specially reverse loop to Delete Paragraphs)

This is regarding my answer with SO post How to remove paragraph marks with different format in MS-Word. My primary question, is there any way performance of the code could be improved to operate on ...
1
vote
1answer
57 views

Copy-Pasting (kind of) from Excel to an existing Word table

What I'm trying to do here is to open an Excel file and then search for and store the data I need (i.e if there is a reference then I copy 2 columns). Afterwards, I paste or write that data into a ...
3
votes
0answers
97 views

Visual Fox Pro Automation

I wrote this code to automate in Word from Visual Fox Pro. I put between the escapes <|< and >|> some VFP code (like ...
0
votes
0answers
46 views

Looping through table rows and replacing key terms in a word template

Here is my code for a sub which does the following: read header of a table into an array reads first row of said table into a 2nd array loops through the first array and replaces the marked ...
4
votes
4answers
182 views

A Word macro that processes trainees' dictation, highlighting errors and checking accuracy

I work in the training department of a captioning agency, where I spend a lot of time grading trainee's dictation transcripts. We receive the transcripts of trainee's dictation of test audios and ...
7
votes
3answers
206 views

Standardized and automated Class block generation for VBA

I recently developed a tool which automaticaly generates VBA code in order to smoothly create class templates. I wanted to share this tool with the community, hopefully this is the right place. The ...
1
vote
1answer
52 views

Text extraction of document files

I have this script that pulls text out of .docx, .doc and .pdf files and uploads that text to an Azure SQL Server. This is so users can search on the contents of those documents without using Windows ...
6
votes
2answers
4k views

Modifying a Word document template with OpenXML

I have the following program that opens a Word document template using the OpenXML library and replaces a couple of phrases with their counterparts from what will be a database (right now its just ...
3
votes
1answer
407 views

Large find/replace in Word using VBA

I have a large amount of data from a hardware device that needs to be cleaned up so it can be analyzed in Excel. I wrote a simple find/replace VBA macro in word to convert it to .csv, but the macro ...
7
votes
4answers
7k views

PowerShell script to Find and Replace in Word Document, including Header, Footer and TextBoxes within

I have written a PowerShell script to find and replace text within the whole document, including in the Headers and Footers as well as inside TextBoxes within the ...
2
votes
1answer
436 views

Create rotated textboxes

I made code in VBA Word to do exactly the thing I want to do. I would like to ask if there are ways so that Word implements this faster? ...
1
vote
1answer
49 views

Add spaces around variable with $ symbol bookends

I have some code in a particular coding language, and I am trying to clean it up by adding spaces around the variables. I wrote this code, and it works on small amounts of text and if I set a break ...
0
votes
1answer
394 views

Speed up search/replace in VBA Word

I have a word document with 450 pages (and growing) in witch I make a search and replace (linking referencies) after inserting new text. Unfortunately this procedure is very slow. Have you any ...
5
votes
1answer
201 views

Error handling to restart Word from Excel inside a loop

I'm often opening, from Excel, all Word documents inside a folder. And sometimes during the treatments, Word crash without throwing an error. So I've added a bit of error handling to restart Word ...
4
votes
0answers
43 views

Word - convert list of images to images

I don't work much in Word VBA so I approached this similar to how I'd approach it in excel, which may not have been optimal. I also didn't see any places for errors to be handled. This takes a Word ...
2
votes
0answers
792 views

Find and replace text inside text boxes in MS Word

I have this procedure to realise a find and replace on a word document. Since I have text boxes, using this way to do this is a bit a slower than what I'd like it to be, if it were just text on a ...
1
vote
0answers
2k views

Mail merge with attachments and cc for MS Word

I am very new to coding and really started a few weeks ago for a new job I have. out of necessity, I am slowly learning VBA (which I can't say is very easy...) I started by recording macros in Excel ...
2
votes
1answer
1k views

VBA Macro - Speed decreasing with every loop iteration - substituting Word bookmarks from Excel

I previously asked this question but have since improved my code: Substituting bookmarks in a Word document with data combined from an Excel sheet What happens in the code: Information about a list ...
4
votes
1answer
258 views

Handling dozens of checkbox events in a Word document

I have a word document which has a lot of active x checkboxes on it and I have just been told the way it has been coded and done could be improved upon a lot, so I am asking for a bit of help. To ...
9
votes
1answer
585 views

Document Merger using PhpDocX

I'm developing a document merger that utilizes an FTP site containing hundreds of documents. FTP Connection Function ...
3
votes
2answers
682 views

Take all underlined words, put in Excel column

I have a 100+ page Word document, that I would like to extract all of the underlined words from. I am very familiar with VBA and Excel, but relatively new to Word. I was wondering if this is the best ...
8
votes
2answers
5k views

Word VBA function to find a specified heading & return its text as a string

In this post, I asked for an overall review of a script to auto-generate table captions, because it was running relatively slowly. I've used Debug.Print to isolate the problem, and this function takes ...
2
votes
1answer
1k views

Finding and deleting a certain word

I have a working macro that finds a specific word and deletes the whole text. It finds the word "JOBSPECIALTYCODE" in the sheet, selects and deletes it, then moves to the next sheet. I just want to ...
14
votes
3answers
608 views

Modularise Project and Deduplicate Code By Loading External Modules On Startup

Starting point I kind-of inherited a VBA project at work that consists of a bunch of Word document templates that provide users with the tools they need to create documents according to company ...
3
votes
1answer
1k views

Converting Hindi Devanagari proprietary font to Unicode font

This working macro converts Hindi Devanagari proprietary font to Unicode font. It reads the conversion table from a tab delimited file, and converts one by one by finding all matches and then does ...
4
votes
1answer
355 views

Script to generate documents based on conditionals and CSV data

I wrote this script a while back to generate press releases. It consumes a csv of data where each row contains the data for a country and fills in values in pre-written text based on the data. In its ...
4
votes
1answer
557 views

Searching a Word Document from Excel - v2.0

My first question: Searching a Word Document from Excel Since then I have implemented most of the suggestions by @RubberDuck and @Comintern. I have also added functionality for different-sized ...
11
votes
2answers
11k views

Searching a Word Document from Excel

Today I created a script in Excel that migrates data from a specific Word document and copies a portion of it to a cell in Excel (the date to be specific). The file input is Last name, First Name, ...
7
votes
1answer
756 views

Macro for inserting a mini table between heading styles

I am using the following macro to insert a mini table of contents between two identical heading styles (e.g. Heading 1). It works fine on small documents, but is very slow on large documents. ...
7
votes
1answer
1k views

Extracting data from a Word document is too slow

I have a 100page long .docx format document. I'm using a macro written in VBS to extract some information and then just generate a table from them. I iterate through the paragraphs and store the ...
7
votes
1answer
701 views

Build menu from MS Word XML

I've recently assembled some jQuery that allows a user to build out a bulleted list in MS Word with hyperlinks and turn that into a HTML unordered list. Ideas for uses are website menu systems where ...