Duplicate table in Applescript Dialog Box

I want to duplicate a 10x21 table from Word with properties to an applescript dialog box - is this possible?

Thanks

Hi there,

Welcome to MacScripter!

Is this kind of what you were looking for?

tell application "Microsoft Word"
	activate
	
	if (get selection information selection information type with in table) is "True" then
		
		display dialog "Table Info:" & return & return & "Columns = " & (get selection information selection ¬
			information type maximum number of columns) & return & "Rows = " & (get selection information selection information type maximum number of rows)
		
		set maxCols to (get selection information selection information type maximum number of columns)
		
		set maxRows to (get selection information selection information type maximum number of rows)
		
		make new table in active document with properties {number of columns:maxCols, number of rows:maxRows}
		
	end if
	
end tell

Before executing you’ll need to place your cursor in one of the cells of the table you wish to duplicate or select the whole table. You’ll probably also want to add a couple of carriage returns at end of the doc.

Thanks TecNik,

I have a 10x21 table open and populated in Word, but I am trying to create a dialog box that shows the 10x21 table. Is that possible? I have provided a link below of an image showing roughly what I am after, but in Applescript dialog box form.

https://support.sas.com/documentation/cdl/en/citug/61084/HTML/default/images/view-detail-dialog.gif

Thanks for your help

Thanks for posting the image, that makes it quite a bit clearer.

Now I can see what you’re trying to do I think you’ll need something more than ‘vanilla’ applescript to do it.
I’m sure someone will correct me on this if I’m wrong but here goes, I think you need to bring Cocoa dialogs into Applescript maybe using something like AppleScript-Objective C (http://www.macosxautomation.com/applescript/apps/book.html)

HTH