Short Microsoft Word Macro to Resize All Equation Tables to 100%


Here is a short Microsoft Word Macro for resizing all equation tables in your Word document to 100% with 90-10% equation/number ratio

In the Developer tab, open a new Macro and write the code below and run.

Sub ResizeAllTables() Dim oTbl As Table For Each oTbl In ActiveDocument.Tables If (oTbl.Columns.Count = 2) Then For Each oRow In oTbl.Rows If (oRow.Cells.Count = 2) Then For Each OM In oRow.Cells(1).Range.OMaths OM.Type = wdOMathInline OM.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter Next OM If (oRow.Cells(1).Range.OMaths.Count > 0) Then oRow.Cells.VerticalAlignment = wdAlignVerticalCenter oRow.Cells.PreferredWidthType = wdPreferredWidthPercent oRow.Cells(1).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter oRow.Cells(1).Width = 90 oRow.Cells(2).Range.ParagraphFormat.Alignment = wdAlignParagraphRight oRow.Cells(2).Width = 11 End If End If Next oRow oTbl.PreferredWidthType = wdPreferredWidthPercent oTbl.PreferredWidth = 100 End If Next oTbl End Sub {codeBox}

Post a Comment

Previous Post Next Post