1 Reply Latest reply: Nov 15, 2012 7:22 AM by Gysbert Wassenaar RSS

    How do you apply selection criteria in a Macro ?

    Neil Gulliver

      Hi,

      I am currently exporting a whole table CH02 using a macro.I need to set the selection criteria in a macro so that I can export only one particular name from the CH02 table. The code I have currently is:

       

      sub ExtractData

         Const ForReading = 1

         Const ForWriting = 2


         vExFolder = ActiveDocument.Variables("vFolderName").GetContent.String


         vFullFileName = vExFolder & "Census Data" & ".xls"


         set sObject = ActiveDocument.GetSheetObject("CH02")


         sObject.Export vFullFileName, ""


      end sub

       

      The selection criteria has to be done within the macro rather than using the Set Variable Action asI would also like to clear that field afterwards so that I could export the details of another name to a different destination within the same macro.

       

       

      Many thanks,

      Neil