I have the following code:
Sub vbRemoveSpacing() Dim doc As Document Set doc = Documents.Open("C:/Document.docx") For Each tbl In doc.Tables With tbl With .Range.ParagraphFormat .SpaceBefore = 0 .SpaceBeforeAuto = F .SpaceAfter = 0 .SpaceAfterAuto = F End With .Rows.SetHeight RowHeight:=0.1, HeightRule:=wdRowHeightAtLeast End With Next doc.Close (True) End Sub
And I want to be able to run it from a .vbs file. Copying it into a .vbs file and running it gives an error
Error: Expected end of statement
Even removing that line of code returns a similar error later on with
.Rows.SetHeight... having a similar issue. What’s going wrong?