- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kaushik,
Thanks a lot for your reply. Your code is working excellently but small change is required we need to keep Qualify * before Resident load. B'coz we are already loaded 'selected table in edit script'.
But how can i pass dynamic conditon for different fields in table. Instead of placing condition in the script can we provide from front end dynamically.
sub gen_qvd
rem ** show each possible value in list box **
set docprop = ActiveDocument.GetProperties
set LB = ActiveDocument.GetSheetObject("LB01")
boxvalues=LB.GetPossibleValues
for i = lbound(boxvalues) to ubound(boxvalues)
if boxvalues(i) = "Customers" then
' Replace the text with the Table name (Case Sensitive)
docprop.Script = docprop.Script & chr(10)
"QUALIFY *;" & "Temp:" & chr(10)&"Load * Resident " & boxvalues(i) &" where CustomerID>20; " & chr(10) & "Store " & boxvalues(i) & " Into ../" & boxvalues(i) & ".qvd;"& "UNQUALIFY *;"
else
docprop.Script = docprop.Script & chr(10) & "Store " & boxvalues(i) & " Into ../" & boxvalues(i) & ".qvd;"
end if
ActiveDocument.SetProperties docprop
Next
'ActiveDocument.Reload
end sub
Thanks,