02-10-2016 04:05 PM
I need to save the Datafinder results into a file. As shown in the image, I want to save flename, folder, date. Please help.
02-11-2016 08:31 AM
02-11-2016 09:14 AM
Hi IIx,
Here's code that puts your search results on the Windows clipboard, ready to paste into Excel:
OPTION EXPLICIT
Dim i, j, iMax, jMax, Elements, Columns, ColPaths, ReturnType, Msg, Prop
If Navigator.Display.CurrDataProvider.IsKindOf(eDataFinder) Then
Set Elements = Navigator.Display.CurrDataFinder.ResultsList.ResultsElements
Set Columns = Navigator.Display.CurrDataFinder.ResultsList.Columns
ReturnType = Navigator.Display.CurrDataFinder.QueryForm.GetCurrQuery.ReturnType
iMax = Elements.Count
jMax = Columns.Count
IF iMax > 0 AND jMax > 0 THEN
ReDim ColPaths(jMax)
FOR j = 1 TO jMax
Msg = Msg & Columns(j).Property
IF j < jMax THEN Msg = Msg & vbTAB
ColPaths(j) = Columns(j).GetPath(ReturnType)
NEXT ' j
Msg = Msg & vbCRLF
FOR i = 1 TO iMax
FOR j = 1 TO jMax
Set Prop = Elements(i).Properties(ColPaths(j))
IF Prop.DataType = DataTypeDate THEN
Msg = Msg & Prop.Value.VariantDate
ELSE
Msg = Msg & Prop.Value
END IF
IF j < jMax THEN Msg = Msg & vbTAB
NEXT ' j
Msg = Msg & vbCRLF
NEXT ' i
MsgBox "The Search Results have been sent to the Windows clipboard"
Call TextToClipboard(Msg)
END IF
END IF
Brad Turpin
DIAdem Product Support Engineer
National Instruments