21,484 questions
1 vote
0 answers
72 views
How to run VBA scripts only in the Word document I'm currently editing? [closed]
I have this code: Private WithEvents App As Word.Application Private Sub Document_Open() Set App = Word.Application End Sub Private Sub Document_New() Set App = Word.Application End Sub ...
0 votes
1 answer
96 views
How to insert nested fields in VBA for Word? [closed]
I would like to make a VBA macro for Word 2021 that will insert an IF field with STYLEREF fields inside it, to show the beginning and ending paragraph numbers in a page header. I am able to insert the ...
-2 votes
0 answers
29 views
TOC (Table of Contents) dot leaders and page numbers not aligning properly [closed]
[https://prnt.sc/-yrGCth-33oS] Hi everyone, I’m having a persistent issue with Word’s Table of Contents formatting and I can’t fix it through styles or tab stops. In my TOC, the dot leaders stop at 14....
5 votes
1 answer
117 views
Word.Document Close ComException
We have some legacy code that late binds to Microsoft.Office.Interop.Word to do various things with documents. This code has worked fine for years. The Solution is written in VB.NET and consists of ...
1 vote
2 answers
116 views
wdFindStop not Stopping Replace at End of Specified Range
I have code that searches for a particular unique pattern and, if found, replaces that pattern. The replace should be limited to the paragraph in which the match is found, but instead it is executing ...
0 votes
0 answers
79 views
async function not executing via Word dynamic menu ribbon button
I have a dynamic menu button in our custom VSTO ribbon. I am loading content to it at runtime. That process is working fine. Dynamic drop down is creating fine. this is the code. In Ribbon.xml <...
0 votes
0 answers
29 views
New VSTO Word Add-In unable to start word
I created a new C# VSTO Word-Add in (Framework 4.8.1) in Visual Studio 2022. Made no modifications at all and then tried to start it (F5), but it ends with this error message: -------------------------...
0 votes
0 answers
47 views
Word Online Fails to Render Diagrams/SmartArt via WOPI: ResReader.ashx 404 Errors
We have integrated Word Online functionality into our web application using the WOPI protocol to allow users to edit, review and approve Word documents. While standard text documents load and co-...
0 votes
0 answers
81 views
Parsing Word docx file gives "Namespace prefix m on oMath is not defined in Entity" [duplicate]
i am creating laravel project that parsing word doc and docx file into elements in json format. I use phpword library and loading IOFactory::load($path) code. In loading time i get error DOMDocument::...
1 vote
1 answer
50 views
OpenXML TableRow bottom border hidden by next row
Trying to apply a bottom border to a table row using <w:tblPrEx>, the bottom border is hidden by the next row, even if I give the next row a top border. If I delete the next row the bottom ...
1 vote
1 answer
91 views
Using InsertXML method to modify a Word document in VBA
I need to do some heavy find-replace modifications in a bunch of Word documents and I am trying to speed this up by making this a string operation using the Office Open XML. I can extract the XML ...
0 votes
1 answer
74 views
Mail merge with hyperlinks inside if statement (Microsoft word) [closed]
I am trying to create a mail merge with a hyperlink inside of an “if” statement (the link only appears if a certain mergefield exists), where both the link address and display text are different ...
2 votes
1 answer
71 views
Trying to append hyperlinks (to bookmarks) given a selection in Word
I've got a selection of text highlighted that I want to convert into links (to already created bookmarks that conform to a pattern) in MS Word (Mac if it matters). Right now I'm just trying to append ...
0 votes
3 answers
145 views
VBA Selection.InsertCaption and automatically adding non-breaking space between the label and number
Recently I had the pleasure to review a few specification documents edited in MS Word, containing around 1000 tables and figures, each of those with a caption that did not separate caption label and ...
0 votes
0 answers
26 views
Exceed DocX (Word) Bulletted lists not working?
trying to add a bulleted list of answers under a question, but if I use the code specified in the docs, nothing shows up in outputted file. Anyone can help? var idxQuestion = 1; ...