Questions tagged [word-vba]

Word-VBA is (Visual Basic for Applications for MS-WORD) and is the dominant programming language for Microsoft Office Word.

2
votes
2answers
18 views

Changing all Cambria Math italic font in an equation to non-italic using Visual Basic in Word

Regular Find & Replace does nothing. So I am dealing with this program in Visual Basic to run inside MSWord.Equations in Word use the font Cambria Math, italic.I want to change all equations ...
-1
votes
0answers
11 views

Exporting word doc to sharepoint macro

I'm trying to write a macro to convert word documents to PDF then save them in the company Sharepoint. The macro I was using to convert and export the documents locally worked fine, it just needs ...
0
votes
0answers
5 views

Edit page number in page footer in Word document with VBA

I need to change page number from "1" to "—— 1 ——" (Not the short - so I can't simple change the page number style). How can I do this in VBA?I tried the following code but the second —— is out of ...
0
votes
1answer
19 views

How to assign a macro in a Word Document to open a PDF to specific page

I am trying to assign a macro with commandbutton in a Word document which when clicked should open a PDF document of page 9. I trying with the below Code but not successful in solving my Problem. I ...
-2
votes
0answers
27 views

Text replacement in word with VBA [on hold]

I'm trying to get MSWord's vba to interchange two letter: "x1y1" with "y1x1" if the next letter of "x1" is "y1". there are such 15 such "x" is stored in a text file and there are 35 "y" stored in the ...
0
votes
1answer
24 views

VBA store path including Environ(“username”) in a text file

I am trying to create a text file that stores a folder path. This text file is then referenced via a vba sub. The path I want to use is something like:"C:\Users\" & Environ("username") & "\...
1
vote
1answer
31 views

How Content Controls are indexed in repeating Section Content Control?

I have document with two paragraph: in the first one one Plain text CC and in the second one repeating section CC with one Plain Text CC inside.I am trying to move all the info from CC's in ...
0
votes
2answers
31 views

Cannot open Word .docm document saved with VBA

I am trying to save a Word Macro-enabled template and then send the resulting file via email, but the file saved (and sent) as .docm cannot be opened. It throws this error:"We're sorry. We can't ...
0
votes
2answers
54 views

Count replacements made by “Replace All” in VBA

I'm working on a macro that parses a document and modifies style when needed. So far, one of my sub uses Find & Execute with a loop to go through all paragraph with a defined Style. It worked well ...
-2
votes
0answers
35 views

Converting verbs to their gerund form [closed]

I created the following code, which seems to have answered my question below. Unless someone has a better or more efficient way to do this. Anyway, I am posting the code here. Original Question:...
0
votes
1answer
27 views

From MS Word, how can I add a slide in Powerpoint using VBA

I am trying to add a slide in a Presentation but I am having an error.Context:I have a word file that contains more than 200 pages. Each page contains an image (a screenshot). I want to create a ...
0
votes
1answer
34 views

paste table from multiple excel sheets to word file and name word as sheet name VBA

I have excel file with many sheets.In each sheet I have 3 tables witch I need to be pasted in a word document.I need to create a word template and name it as sheet and paste 2 tables.Sub Separate()...
1
vote
2answers
47 views

Cannot get WholeStory to select & format all text in a Word Doc using Excel VBA

I need to be able to generate a report (in Word) that utilizes a bunch of data that is stored in Excel. I am having issues when I try to format the entire Word Document (the report title AND ...
1
vote
4answers
64 views

VBA for Word: Using array to count word and phrase matches in text

I am new to VBA and trying to create a project for work. We hire transcriptionists based on a sample test file they listen to and type up. I've been trying to code a macro that will search the tests ...
-2
votes
0answers
19 views

Let users select the file while running mailmerge and then update in word2016

`Sub SelectFile()'' SelectFile Macro''Dim dlgOpen As FileDialogSet dlgOpen=Application.FileDialog( _FileDialogType:=msoFileDialogOpen)With dlgOpen.AllowMultiSelect=True.Show...
0
votes
0answers
20 views

Office 365 vbaproject.otm Outlook folder doesn't exist, but does…?

We have an integration for one of our clients that makes use of a 'vbaproject.otm' file. As part of a new PC configuration I was running through the normal setup process of dropping the vbaproject....
0
votes
0answers
31 views

Template addin crashes Word in Windows 10 /Office 365 only

Windows 8 Machine (works):Microsoft Office Professional Plus 2013Windows 10 Machine (doesn't work):Microsoft Office 365Template (.dotm file) gets placed in Startup folder for Word.When I start ...
0
votes
1answer
20 views

True value from SQL being brought into listbox as -1

Never run into this before. I'm bringing some column values into a listbox from SQL server using VBA. One of the columns, Exception, is a boolean so it's value in SQL is either 0 or 1. However, when I'...
0
votes
1answer
28 views

VBA Runtime Error 5941 Searching for blank fields

I'm trying to write a macro to find and tag all blank DOCPROPERTY fields in a specified selection of text. When I try to run the macro it will tag some of the required fields with the text, but not ...
0
votes
1answer
26 views

Word VBA to copy data from several Word documents to one Excel workbook

I have about 100 Word documents and from every one of each I want to copy data and paste it all in one excel workbook.I came up with this code which opens one Word document, copies data, pastes it ...
0
votes
0answers
18 views

vba Word: Adding Selected text into right click menu or adding right clicked text into right click menu

I want to add Selected text into right click menu as a .captionhere is my codePublic Sub CreateMacro()Application.CommandBars("Text").ResetDim MenuButton As CommandBarButtonWith CommandBars("...
0
votes
0answers
42 views

LockWindowsUpdate Works in Office 2010 but not Office 2016

I have, for some time, been using the LockWindowUpdate API to prevent screen flicker and speed up code execution in MS Word. It works in Office 2010 (64 Bit).It does not work as expected in Office ...
-1
votes
1answer
30 views

Running MS Word, Macro font

(Patience my stroke)What are the codes to create a table in MS Word, macro? I need to make a table font. If...Then...Else (Aharoni, Century Gothic, Arial).Help?So sorry :( I might merge:
0
votes
0answers
11 views

print special char as char in word form letter

I had to build a form letter with word and a sql data source.Now I have the problem that in the name fields of the master data there are some names that are identified as special characters and stop ...
-1
votes
1answer
42 views

Python win32com Show VBA UserForm

I'm trying to control Word using a Python3 script using win32com. I've imported a VBA UserForm, and am trying to show it but receiving an error. Some code:from win32com.client.dynamic import ...
1
vote
0answers
39 views

Adding and Setting Text to Content Controls within Repeating Section Content Control

I have a word template that is filled in with information from an Access database and part of that template includes a table with two cells, type and location, for all attachments for that specific ...
0
votes
2answers
40 views

MS-Word: Cross reference to custom reference type

I'm trying to add a cross reference into a SEQ field.My document contains "point headings" which means that between two heading elements, the user can add an extension (between 1.1 and 1.2 may be 1....
0
votes
1answer
40 views

Looking to Create a Macro for Printing Addresses to Envelopes

First question on here, so hopefully I have followed all the guidelines etc.I am looking to create a macro for a Word document which prints a headed paper copy, a yellow paper copy and an envelope (...
0
votes
1answer
32 views

How to import svn ressources to microsoft word?

I must create some documentation with mircosoft word.Well, I have several resources within my sofware project which I need to show in my documentation. Now I would like to invoke some kind of svn ...
0
votes
2answers
38 views

Checking if a Word table's cell is empty - Empty cell containing a “marker”

This Word file has a giant table with 2 columns. I have to make a statement like: If theCellIsEmpty, thenFill itEnd ifThe thing is that when I get the content of the cell through:...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,