Xojo.Io and SpecialFolder.SharedDocuments

I use this code found in the forum

[code]using Xojo.io
dim f as FolderItem = SpecialFolder.Documents

for each i as FolderItem in f1.Children
if i.IsFolder = false and i.IsVisible then Listbox1.AddRow i.name
next[/code]

However when try to use it with SpecialFolder.SharedDocuments and read files on a second level subdirectory in it, I got errors as I can’t use f1 = f.child(“xxx”)

Is anybody can help me?
I appreciate it in advance

f1 is never defined.

Sorru i put the wrong code. This is which troubles me

using Xojo.io
dim f1 as FolderItem = SpecialFolder.SharedDocuments

for each i as FolderItem in f1.Children
if i.IsFolder = false and i.IsVisible then Listbox1.AddRow i.name
next

Dim f1 as folderitem = specialfolder.ShatedDocuments gives me an error “item dies not exist”

I try to read all the files stored in public directory users/public/public documents in windows or shated_documents in XOjo Cloud

Your testing if item is not a folder and is visible
no need to test if item is visible ??
test if item exist (if i.IsFolder = false and i.exists)

using Xojo.io

then SpecialFolder is Xojo.IO.SpecialFolder and there is not a SharedDocuments method

you have to use something like:

using Xojo.io
Dim fOldNowNew As Global.Folderitem=Global.SpecialFolder.SharedDocuments
dim f1 as  New FolderItem(fOldNowNew.NativePath.ToText)

… then you can use the f1 iterable functionality