Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
ActiveDocument.Fields("Month").Select("Sep") will select value 'Sep' in field Month.
ActiveDocument.Fields("Month").Clear will clear the selection in field Month.
ActiveDocument.Fields("Month").Select("Sep") will select value 'Sep' in field Month.
ActiveDocument.Fields("Month").Clear will clear the selection in field Month.