Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing Table in Macro

Status
Not open for further replies.

Elvis72

Technical User
Dec 6, 2007
211
US

Hello!~

I am trying to setup a Macro that will create a table header and resize the cells.

When I create the macro it will not let me edit the table parameters, I can't change the margins or the cell size?

Is this a finite thing or is there a work-a-round?

Thanks!~
 


Hi,

What application?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 

Well this is what I have figured out this far...

I am in Word...and I was able to create the Header Table using the AutoText Function....works Great!~

So, I created another AutoText for the next line in the table, works great...Except when I try to use a Macro to insert a Field for the ListNum, it will not let me click into a cell on the table.

This being said...now hanging the parameters of the table in the Macro is not an issue, BUT now I can't access the cells in that table...

 
You should be able to reference by table number. To control height, you would do something like:
Code:
Selection.Tables(1).Rows([i]Row Number[/i]).height = InchesToPoints([i]Height in Inches[/i])
To modify the data in the row do something like
Code:
Selection.Tables(1).Cell([i]Row[/i], [i]Column[/i]).Select
Selection.TypeText text:="Hello World!"
For information on how to do other things with the macros, I would recommend creating a table like you would like, then creating a new macro by recording it, do the process that you would like to try, and then look at the code for the recorded macro. This is a great way to figure out functions and code for things you haven't played with before.

Hope this helps.

- flub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top