Why does Microsoft Word 2016 (16.0.5426.1000)MSO (16.0.5422.100) 32-bit hang when executing these 2 macros?

99 views Asked by At

Create the test document from an empty document by executing:

Sub CreateHangDocument()
    With ActiveDocument.Tables.Add(ActiveDocument.Range, 2, 3)
        .Descr = "A"
        .AllowAutoFit = True
    End With
End Sub

Then hang the application:

Sub Hang()
    Application.UndoRecord.StartCustomRecord "Hang"
    With ActiveDocument
        .PageSetup.LeftMargin = 45.35
        With .Tables(1).Rows
            .Add .Item(1)
        End With
    End With
End Sub

Every time I had to terminate the process.

It does not matter whether the macros are executed from the Macro dialogue in the main application or by placing the cursor in the macro code in the editor and pressing F5 (run). It is a minimal test case as far as I know. Remove any part and it will not hang. Combine the functions into one and it will not hang. Replacing LeftMargin with RightMargin makes no difference.

0

There are 0 answers