Microsoft Word 2013 is a commercial document editing program used for creating richly formatted documents for printing and distribution.
Questions tagged [word-2013]
104 questions
13
votes
8 answers
"You are not allowed to edit this selection because it is protected." but only since Office 2013?
We've had these few lines of code running happily in our applications for several years (and in several versions of Office, 2003, 2007, 2010 etc). Purpose is to perform a kind of a mail merge in a Word document, substituting the field placeholders…

hawbsl
- 15,313
- 25
- 73
- 114
9
votes
3 answers
Pywin32 save .docx as pdf
I'm using Word 2013 to automatically create a report as a docx and then save it as a pdf format.
But when I call the function SaveAs2(), the script pop out the "save as" windows and throws this exception :
(-2147352567, 'Exception occurred.', (0,…

RenShan
- 91
- 1
- 1
- 4
9
votes
5 answers
Run Word 2013 from command line
Some of our clients have a problem we can not reproduce here inhouse: Out software uses MS-Word for producing form letter. Since some of our clients use Office 2013, this function won't work anymore.
We tried to reproduce this and detect that on the…

Michael
- 858
- 1
- 5
- 11
7
votes
2 answers
BUG: Word 2013 VSTO Cannot Handle Image in Header Formatted Behind or In Front of Text
I am cross-posting this question from Microsoft Community because I haven't gotten any response there, and maybe someone here can shed some light on this.
I have noticed an issue that is specific to Word 2013 when using VSTO to process a…

Sameer Singh
- 1,358
- 1
- 19
- 47
7
votes
2 answers
Stop Layout Options icon appearing by default on callouts in Word 2013
This is driving me mad! I love the new layout options in Word 2013, but when a callout gets to a certain size the icon for it obscures the end of the arrow, and you can't move the arrow:
Don't suppose anyone knows either how to get rid of the…

Andy Brown
- 5,309
- 4
- 34
- 39
7
votes
1 answer
Auto displaying form on opening a template file, dotm from explorer
I have written a form based document generation macro (in VBA) for distribution to a sales team.
For their ease of use, I want to provide a self-contained file which will display the form as soon as the document is opened.
Using AutoOpen I can get…

fraz
- 73
- 1
- 1
- 3
5
votes
1 answer
Assigning Custom Unique IDs to Word 2013 OpenXML Elements
TLDR/Question
How can I best assign unique IDs to (ideally all) of the elements in the XML that describes a Word document such that I can read/write those unique IDs from a Word (2013) Add-In?
Additionally, solutions describing ways I can get a good…

Adin Schmahmann
- 263
- 1
- 7
5
votes
1 answer
Range.Find.Execute fails in word 2013
Consider the following table in Word 2013
A BBB
A CCC
D E F
A, B and C are merged cells.
A and B are empty. C has text A inside.
Now the following code
Set rng = ActiveDocument.Range(0, 0)
With rng.Find
.Forward = True
.Wrap = wdFindStop
…

kilotaras
- 1,419
- 9
- 24
4
votes
0 answers
When Resizing Custom Task Pane It is Flickring ,Working Fine in Word 2010 but in Word 2013 it is Flickring
public void flow_Resize(object sender, PaintEventArgs e)
{
FlowLayoutPanel flow = sender as FlowLayoutPanel;
var item = listCtpMgr.FirstOrDefault(o => o.flp.Name == flow.Name);
if (item ==…

Khatri
- 61
- 1
- 3
3
votes
2 answers
Error Closing OLEObject Excel.Sheet After Creation
Say you wish to create and then close a linked excel sheet:
Dim shp As shape
Set shp = Application.ActiveDocument.Shapes.AddOLEObject(ClassType:="Excel.Sheet")
DoEvents
shp.OLEFormat.Object.Close
This fails with this error:
Run time error…

David Rogers
- 2,601
- 4
- 39
- 84
3
votes
2 answers
Updating page numbers in VBA
I have a Word document that uses many different fields. I wrote a macro that updates all the sequence, reference, page, and numpages fields in the document.
Updating text fields reverts them back to their default text so I don't want those updated.…

Mike Lloyd
- 31
- 2
3
votes
1 answer
InsertCrossReference Fails On Last Item
I think I have found a bug with the InsertCrossReference. If I use from code for the last list item in the document and there being nothing after that list item, it fails with error "Run-time error '4198' Command failed". If you do it manually, it…

crookie
- 240
- 3
- 14
2
votes
1 answer
Calling Macro from inside Macro - Error Compile Error: Expected variable or procedure, not module - Private Sub App
I have been copying code moslty to work on and learn macro's in Word. I have got it working where I can get a MsgBox to appear before printing, but I would like it to call another module/macro to compartmentalize the modules.
For testing, this…

FreeSoftwareServers
- 2,271
- 1
- 33
- 57
2
votes
1 answer
Word 2013 Crash on Find.Execute
I'm using VSTO ThisAddIn and Word 2013.
I want to replace all occurences of the one string with another using Find.Execute and mark this action with custom undo message. The code is:
application.UndoRecord.StartCustomRecord("Some Message");
var…

Ivan Rubanau
- 374
- 2
- 12
2
votes
0 answers
Selected printer-tray does not print Word document
I have an application (word-addin), which has a class that should print a Word-document at a selected printer & tray. It's working now, but it ignores the selected tray and always prints from manual feed. My class is the following:
class…

Marcel
- 917
- 3
- 19
- 48