List the Search Results
List the Search Results
(OP)
Hi,
After searching for particular set of items in macro, how to export the search results in a xl or notepad?
Thanks in Advance.
After searching for particular set of items in macro, how to export the search results in a xl or notepad?
Thanks in Advance.





RE: List the Search Results
The idea is to create first a text file then fill it by writing what you are reading in CATIA
Dim oFilIn
Set oFilIn = FileSys.CreateFile(FileOut, FALSE)
Dim oStream
Set oStream = oFilIn.OpenAsTextStream("ForWriting")
With something like this you can get the names of your selections.
for i = 1 to selection1.count
Name = selection1.item(i).Value.name
oStream.Write Name & ";" & chr(10)
next
Here you close the operation of writing in text file
oStream.Close
Such operations you can find searching in the forum or on Google....
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: List the Search Results
Thanks.
Actually what I need is the path of the item(s) which we search.
In search results, we will have Name & Path of the Item. I am able to export the name but not able to get the entire path.
Kindly suggest a way.
Thanks in Advance.
RE: List the Search Results
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: List the Search Results
What kind of items are you trying to get the path for?
To export various text info to excel (or csv) use the code below.
CODE --> vba
Dim strFilePath As String Dim objFSO As Object Dim objStream As Object strFilePath = "C:\Users\Drew\Desktop\dimensions.csv" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objStream = objFSO.OpenTextFile(strFilePath, 8, True, 0) For i = 1 To oSel.Count objStream.WriteLine (dblDims(0, i - 1) & "," & dblDims(1, i - 1) & "," & dblDims(2, i - 1) & "," & dblDims(3, i - 1)) Next objStream.CloseRegards,
Drew Mumaw
http://www.textsketcher.com/
http://www.drewmumaw.com/