Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Changing the heigth and width of a cell in a table in Word using VBScript

$
0
0

 I am using similar code as this:

Set objWord = CreateObject("Word.Application")  objWord.Visible = TrueSet objDoc = objWord.Documents.Add()  Set objRange = objDoc.Range()  objDoc.Tables.Add objRange,1,3Set objTable = objDoc.Tables(1)   x=1   strComputer = "."Set objWMIService = _     GetObject("winmgmts:\\" & strComputer & "\root\cimv2"Set colItems = objWMIService.ExecQuery("Select * from Win32_Service")  ForEach objItem in colItems     If x > 1Then         objTable.Rows.Add()     EndIf     objTable.Cell(x, 1).Range.Text = objItem.Name     objTable.Cell(x, 2).Range.text = objItem.DisplayName     objTable.Cell(x, 3).Range.text = objItem.State     x = x + 1

Next

        

I need to set each row to 1 inch and each column one  to 2 inches column two to 3 inch and column three to 1 inch.  How do this using vbscript.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>