Macro to reformat many tables?

Get help using and writing Nisus Writer Pro macros.
Post Reply
ssampler
Posts: 85
Joined: 2006-06-29 07:56:30
Location: Hudson River Valley, NY

Macro to reformat many tables?

Post by ssampler »

From Word I imported an rtf file with many tables. Most are ill-formed and need to be reformatted. I want to apply the command "Fit to Contents" to all the tables in the document.

I know that I can put a menu macro "Table:Fit to Contents" inside an Applescript. However, for the "Fit to Contents" command to work, it is necessary to click inside a table. Is there (or will there be) a way of automating this process?

Thanks,
Steve
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

I believe the "Select Next Table" macro command behaves badly in the current public beta, but once NWP is out this should do what you like:

Code: Select all

Set Selection 1, 0 # move to start of document
While Select Next Table
	Menu "Table:Fit to Contents"
End
ssampler
Posts: 85
Joined: 2006-06-29 07:56:30
Location: Hudson River Valley, NY

Post by ssampler »

Thanks, Martin!
Post Reply