Here's a modified version of the previous program that writes the results to a file. I'm formatting with commas and using a .csv extension so it will open in Excel but you can easily modify it to output it any way you want.
Public Sub GetiPropertiesOfTopLevel()
' Get the active assembly.
Dim asmDoc As AssemblyDocument
Set asmDoc = ThisApplication.ActiveDocument
' Open the file to write the results.
Dim filename As String
filename = "C:\Temp\PropertyResults.csv"
Open filename For Output As #1
Print #1, "Filename,Has Customer Code,Value"
' Iterate through the files referenced by the assembly.
' These are only direct references so parts and assemblies
' in subassemblies will be ignored.
Dim doc As Document
For Each doc In asmDoc.ReferencedFiles
' Get the "Customer Code" iProperty
Dim customPropSet As PropertySet
Set customPropSet = doc.PropertySets.item( _
"Inventor User Defined Properties")
Dim prop As Inventor.Property
On Error Resume Next
Set prop = customPropSet.item("Customer Code")
If Err.Number = 0 Then
Print #1, doc.FullFileName & ",True," & prop.Value
Else
Print #1, doc.FullFileName & ",False,"
End If
On Error GoTo 0
Next
Close #1
MsgBox "Finished processing." & vbCrLf & _
"Results written to """ & filename & """"
End Sub