The thing with the .Net Api is, that whenever you're dealing with one of the entities of the DocuWare System (FileCabinets, DocumentIndexFields, Documents, etc...) in Your code, You may or may not have the full entity.
In Your case, You are asking the organization for it's FileCabinets, and then each FileCabinet for it's Fields. The FileCabinet instance you have in Your inner ForEach loop is not the full entity, and it's Fields property (and other properties) have not been filled. That's why You're getting a field Count of 0.
In order to make sure that You have the full entity of the FileCabinet, call the GetFileCabinetFromSelfRelation() Method on the FileCabinet itself.
So I guess your first statement in the if-clause should be something like:
fc = fc.GetFileCabinetFromSelfRelation()
Although I'm not sure about VB Syntax. After that, the Fields property should hold all IndexFields.
BeWare that it will also hold the IndexFields ceated by the System, like DWDOCID, DWEXTENSION, etc. You can filter the Fields for their "Scope" property in order to get only the Fields that are explicitly created in the configuration.
Cheers.
Fabian