The elegant way would be to use use CDO 1.21 to determine what type of store the folder belongs to by enumerating the Session.Inforstore collection and comparing each store's EntryID with the Parent.StoreID of the Inbox. The ProviderName will tell you whether it's Exchange, PST or something else.
The brute force method would be to get the Parent.StoreID itself -- if it's a .pst file, the path is embedded in the binary ID. You can use Outlook Spy to see what I mean; I don't have any sample code handy to extract it.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers