CHANGE THE HEIGHT OF THE ROWS IN A MS WORD TABLE

WonHop
WonHop used Ask the Experts™
on
Hello All.
I need to change the Height of of the Rows of a MS Word Table.
Below is the code that creates and changes the Width of the columns.

strAppendixAName = "Appendix_A.docx"
strAppendixAPath = CurrentProject.Path
strAppendixAFullPath = strAppendixAPath & "\" & "Appendix_A.docx"

Dim objWord
Dim objDoc
Dim objSelection

Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add
Set objSelection = objWord.Selection

objWord.Visible = True
objDoc.SaveAs (strAppendixAFullPath)

 objDoc.Select
 objDoc.Activate
 objDoc.ActiveWindow.Activate

'If The Selected Document Is Not Open, A Message Box Will Open Telling The User To Open The Selected File.
If objDoc Is Nothing Then 'The Selected Document Is Not Open.
    MsgBox "Please Open The Selected Document" & vbCrLf & vbCrLf & strAppendixAPath, vbCritical, "Document Is Not Open"
    PID = Shell("explorer.exe " & strAppendixAPath, vbNormalFocus) 'If The Document Is Not Open, This Will Open The File Explorer To The Correct Folder.
    Exit Sub
Else '
End If

objSelection.TypeText ("Appendix A" & vbCrLf & "Total items:  " & inttblAppendixAWorking & vbCrLf & vbCrLf)

inttblAppendixAWorking = 10
intRows = inttblAppendixAWorking
intCols = 2

 'Create Table.  This moves the Table below any data that is in the document.
Set tblAppA = objDoc.Tables.Add(Range:=objDoc.Bookmarks("\EndOfDoc").Range, _
                                                    NumRows:=intRows, _
                                                    NumColumns:=intCols)

tblAppA.Range.Font.Size = 12
tblAppA.Borders.Enable = True

tblAppA.Columns.PreferredWidthType = wdPreferredWidthPoints
tblAppA.Columns(1).PreferredWidth = CentimetersToPoints(3)
tblAppA.Columns(2).PreferredWidth = CentimetersToPoints(14#)

=================================================================
CHANGE THE HEIGHT OF THE ROWS IN THE TABLE
=================================================================
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
You should be able to use similar code to that you used for the column width.
tblAppA.Rows.Height= CentimeterToPoints(2)  ' change 2 to the required height

Open in new window

Author

Commented:
Thanks Norie.  That worked.  

I did make one Change.  I had to add a (s) at the end of Centimeters.

tblAppA.Rows.Height = CentimetersToPoints(0.3) ' change 2 to the required height

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial