Questions tagged [ms-word]
For programming questions related to Microsoft's "Word" editor. Questions on general usage of the editor are off-topic for Stack Overflow; they should be asked on Super User instead.
20,987
questions
0
votes
1
answer
14
views
Search Selected Text & Format into Multiple Tables With Headers
Newbie here.
The Task
There is text in the middle of a long MS Word document that needs to be converted to multiple tables each with a header.
Where I'm at
I have code written where I can select the ...
0
votes
0
answers
7
views
Microsoft Word macro to highlight complete words ending in a set of terms
(This question builds on an already existing and resolved question, to be found here: Microsoft Word Macro for highlighting multiple words)
1.The goal is to highlight in a full-text Word document only ...
0
votes
1
answer
34
views
To remove widow word at the end of the each paragraph
Hi guys I'm new to vba macro I'll get into the topic I'm working on the word document which converted from pdf so it sometimes has widow word at the end of the some paragraph. I need to do the work of ...
0
votes
1
answer
31
views
Replace wording in word file with Excel VBA
I am writing Excel VBA to replace a word in Microsoft Word file with another word. As it involves 200++ documents, i am searching for a coding way to make my progress faster. I try to use the code ...
0
votes
1
answer
20
views
VBA code to put blue borders around images in Word Doc
I have a word doc with PPT slide images in it. I need all the PPT images, but only the PPT images, to have blue borders around them. The slide images are 1.39 x 1.85, which is larger than all the ...
0
votes
1
answer
17
views
How can I avoid the error "This document contains fields that may refer to other files." when adding page numbers to the header using officer in R?
I'm using the officer package in R to create tables and figures that output to a Word document. I want to a "Page X of N" field in the header. The following code does what I want it to.
...
1
vote
0
answers
10
views
How to add a drop cap in a .docx file using python?
I am trying to add a drop cap to some paragraphs of a Word (.docx) document using python.
I know this is possible with Aspose but I do want to use free/open source software.
I can easily modify the ...
2
votes
2
answers
45
views
Find an Excel Cell Reference from within a Word Macro
I am in the process of automating a booking process using Word VBA.
I have everything working wonderfully.
As an extra function I would like to open an Excel file, locate an invoice number, get the ...
0
votes
0
answers
10
views
Automation for Word and Excel (OneDrive Business)
I had to move from Google suite to Microsoft 365. Setting up automations was much simpler on Google suite/Google drive. With Microsoft, I'm having a little hard time trying to find the efficient ...
2
votes
1
answer
25
views
How to set inside and outside margins
I am using python-docx to create a Word .docx in python and I would like to set the inside and outside margins as well as the gutter. How to do so?
Given a section I can set the left and right margins ...
0
votes
0
answers
14
views
Power BI Report Builder Word Rendering Does Not 'Keep Together'
I am generating a report using Power BI Report Builder (same as SQL Server Reporting Services) and exporting to Word. My data is in a table and within this I have a row group and its contents marked ...
0
votes
0
answers
7
views
How do I select only summary info from a series of entries in an MS Word document?
I have a series of country walks (actually something more technical - this is just an analogy), contained in a single document in MS Word. Each walk consists of: (1) Title (2) Summary (length, ...
0
votes
2
answers
19
views
Insert nonbreaking space and nonbreaking hyphen - rmarkdown to word document
Is there a way to insert a nonbreaking space/hyphen when rendering a word document from rmarkdown? In MS Word, these two are special characters a user can insert with a key shortcut or manually. I'm ...
0
votes
1
answer
25
views
Server is busy when open document
I start a new application of word and open a document using Word-Interop. Sometimes this message pops up:
It seems to depend on how long it takes to open the document. Is there any possibility for ...
0
votes
1
answer
35
views
When using the POI library, the order of the charts is different than expected
I'm trying to modify only the data in a predefined chart format using the POI library.
The order is accurate up to three charts, but beyond that, the sequence in which they are retrieved is not ...
0
votes
1
answer
52
views
Converting text with HTML tags to formatted text in Word using VBA
Boxes with question mark from page breaksI am on track to modify text in Word with HTML tags to change it to Word-recognized format. The code below is what I have thus far, but I am looking to modify ...
0
votes
0
answers
30
views
Difficulty Finding Tables in a Word Document using 'python-docx' library
Hello World,
I am working on a Python script using the 'python-docx' library to process a Micrasoft Word document.
My goal is to find a specific paragraph and check if there is a table immediately ...
0
votes
1
answer
23
views
Is Comment.Id immutable in Word JavaScript API?
The Word.Comment class has an Id property. Does anyone know for certain if this is immutable, or can it change between edits or sessions?
https://learn.microsoft.com/en-us/javascript/api/word/word....
0
votes
0
answers
51
views
VBA - Find text string in a "Word-document" and return corresponding line(s) and page number
I am new to the forum and also only recently active in VBA programming. In my current project I would like to realise the following:
I have a text in Word as a default. I have divided the content of ...
0
votes
0
answers
11
views
How to convert any file as OLEObject binary for word document
First I will rename the docx to zip file so i can access the files of the documents
My goal is to change this oleObject directly (using other file like msg/eml), then I will convert back again to ...
-3
votes
0
answers
29
views
How I save the active Word document by taking its name with numbers from line 16
I have a Word template file and I want to write on it, and after that I save it by taking its name with numbers on line 16 inside the active Word file, and between these numbers is a word that I want ...
0
votes
0
answers
14
views
Using lists in MS Word Javascript API
I need some help customizing Word.Lists in MS Word via the JS API.
I'm implementing a Word add-in that manipulate both lists and styles inside the current document. What I want to do is create globa ...
-1
votes
2
answers
56
views
Regex pattern to exclude timestamps
I have the following text:
Master of the universe\n\n(Jul 26, 2023 - 1:00pm)\n\n(Interviewee: Marina)\n\n\n\n(00:00:05 - 00:00:09)\n\n\t Alice: This project. Uh my job is to ask lots of questions.\n\n\...
0
votes
0
answers
46
views
Excel does not forget about my rows, after I deleted Them
The Problem is kinda hard to explain for me, bc english isn't my native language. But I will try my best.
I programmed a macro which moves a table from my excel worksheet into an word Document. Which ...
2
votes
2
answers
51
views
How to edit the font in every row of a table in Word except for the first ones
I wrote a macro in VBA which transfers data from Excel into a table inside of a Word document.
But because it's for work, the Document needs to meet special criteria when it comes to design. Because ...
0
votes
2
answers
16
views
How can I copy charts from Excel to an existing Word document I already have open?
I spend a lot of my work day manually copying and pasting charts from Excel into Word and I'm trying to make something to automate the process for me.
I have made a workbook that allows me to select ...
0
votes
1
answer
45
views
How to open a Word document with its URL using VBA Excel?
I need to open an online Word document with its URL and copy the text and then paste it to a mail using VBA Excel, the thing is I managed to do it with a local Word document but cannot do it with the ...
0
votes
1
answer
65
views
How to transfer formatting when splitting a document into several documents using Word VBA?
I've a Word macro that splits a document into smaller documents if a specific text appears. The document consists of several contracts. The chosen text appears at the end. I choose a storage location ...
0
votes
0
answers
9
views
Extract table information currently in Word
I have 2000 individual Word documents each with a table that includes data (legal document). How can I efficiently move those tables from Word into a new searchable database without having to copy ...
0
votes
1
answer
38
views
Formatting automated word file
I am trying to automate creating and sending a word file through outlook but the formatting (font size, font style, allignment) is not applied.
The excel table I used was just two columns, one for the ...
0
votes
3
answers
59
views
How to make page numbers start from page N at number 1?
Using python-docx how to make page numbers start from another page that the first one but still start at 1?
Using answer to this question, I have come up with the below reproducible example.
It starts ...
0
votes
0
answers
25
views
C# – Open XML SDK – Insert embedded Excel object to Word document
I'm trying to copy a table from Excel Sheet to Word Document as an Excel object. The table has a lot of formatting and colours and merged cells so I think the Excel object should be better than a ...
0
votes
1
answer
31
views
Command Button Save As -Need to go to a specific file path to save and automatically populate the file name
I am trying to have a "template" that will save as a new document when you click the command button. I have figured out to save as but I want it to automatically go to a specific folder and ...
0
votes
0
answers
11
views
UI pixel bug in Office 16
my first post here, i'm having an issue with Office 16 just downloaded on my Windows 11, when i open any app from Office suite i get some strange pixel flashing errors on my UI (ONLY IN OFFICE ALL ...
0
votes
1
answer
47
views
Find and replace in word doc using VBA "invalid outside procedure"
I have to put the same text into several different Word templates and copying and pasting it over and over is quite tedious. So I'm trying to make something that will replace words (the words in <&...
-1
votes
0
answers
25
views
How do I use .NET to get a list of all files linked to by a Microsoft Word doc?
I'm making a small utility in .NET that gets a list of all files (both spreadsheets and word docs) that are linked to from a word document. This is the same list that you see if you go into word, go ...
0
votes
0
answers
14
views
Create empty rows in a Word table with help of VBA
I have a table in Word (I am using Office 365) with nine columns in every row.
See the attached pictures.
I want the macro to make an empty row as soon as the first column changing value.
The empty ...
-1
votes
0
answers
15
views
How to Compare Group Answers in a Word Document?
I have a word document with three columns, column A B and C. Column A represents the question number, Column B is the question, Column C is the response to the question asked for each group to answer. ...
-1
votes
1
answer
29
views
Custom box like equation box [closed]
i have 3 questions about ms.word :
1. How to make a custom box like equation box?
2. How to create a box like this?
3. How to make a line lenght follow the character?
Best Regard
how to code addin ...
0
votes
1
answer
28
views
How to get python-magic to identify file type of docx correctly instaead of as application/zip?
I'm developing a website which allows users to submit files and then I use Python to detect the file type. I learned that all MS Office files are actually zip files but how do I determine that it ...
0
votes
0
answers
13
views
Word 2016 VBA: UserForm Checkbox Feeds 2nd MSDOC Checkbox
Title: Word 2016: VAB Checkbox: Display a variable of a UserForm CheckBox to another variable CheckBox inside the overlying Word Doc.
I have a Word Document that has 6 Checkboxes as 2 sets of 3 each ...
0
votes
0
answers
89
views
Optimize the code to make the Macros run Faster and Efficiently
I'm trying to find a way to optimize my code to run faster. First the code will check the text like "Introduction","Menu" and "Author details" and then it will select the ...
0
votes
0
answers
20
views
Word TextBox ContentControl with border what can be controlled with VBA
I relatively new to these depths of Word!
I try to make a textbox, what I can hide if a Content Control Dropdown is set to a specific value, but when it is visible it's text should be resetted to a ...
0
votes
1
answer
29
views
How to replace header text in a word file using VBA
I am trying to write a code that creates a new file from template file and replaces certain words (titles, document number, project numbers etc.) with a table in excel.
I have currently been able to ...
0
votes
0
answers
12
views
combo box and date picker not working in android version of MS word
I have a crucial need to use a Word file with content controls like Combo Box and Date Picker in the android version of MS Word. However these controls are not working.
here is a Combo box showing ...
0
votes
1
answer
38
views
Overwritten issue when trying to copy chart from Excel to Word in a loop
I want copy the scatter smooth chart from Excel to Word as an image in each iteration of a loop. However the previous image keeps being replaced by the next image. Can someone let me know what went ...
0
votes
0
answers
14
views
Optimising code for processing .docx files
I've recently tried out learning Python. I'm currently trying to make a project that can be used for my work. Basically, it iterates through the whole .docx file and check if each paragraph does not ...
0
votes
1
answer
31
views
Can Microsoft Word VBA automatically insert a non-breaking space into a caption, e.g. Table or Figure caption?
I inherited Word VBA code that inserts an auto-numbered caption for a table or figure, e.g. Table 1. I want there to be a non-breaking space between the label, e.g. Table, and the number, but I ...
0
votes
0
answers
23
views
I have a word merge doc from an access database, when I changed something, it lost the link, and I can't relink it
I have a Word doc that is merged with Microsoft Access Database (file format is 2007-2016). I changed something in the doc that was not part of what was merged from Access, and it lost the link. I ...
0
votes
1
answer
29
views
Word VBA Error 4198 within an error handling loop
This problem is with MS Word VBA
I'm trying to handle a file open error, I'm assuming the file doesn't exist.
First time through the loop with a non existent file it works fine.
Second time through ...