View Single Post
 
Old 09-21-2017, 08:07 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The macros I posted are stand-alone VBA code demonstrating nothing more than how to loop through tables in VBA; they are not VBScript or SAS. You seem happy to use these terms interchangeably, regardless of the fact they refer to quite different things.

I have no idea about how SAS script works, but I very much doubt you'd insert Word VBA macro names (i.e. put 'Sub Demo2()'; ), variable declarations (i.e. put 'Dim Tbl As Table'; ) or "put 'End Sub';". Furthermore, if you're using "put 'For Each Tbl In ActiveDocument.Tables';", you wouldn't need any of:
put 'objDoc.Activate';
put 'With Tbl';
put 'objDoc.Tbl.Range.Select';
put 'End With';

Frankly, I can't see what SAS has to do with what you're trying to achieve. The principles for looping through tables in VBScript are the same as in VBA, but the code is not all the same; neither can you just dump a VBA macro into a VBScript.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote