Why can't I msgbox a FolderItem's location?

I have a method that check to see if a folder exists in the Documents folder and it works perfectly. However, when I try to store the FolderItem as a property I created, I cannot MsgBox it.

  Dim TheLocation As FolderItem
  TheLocation = SpecialFolder.Documents.Child("SolarBox")
  SolarFilesLocation = TheLocation //The property created via the IDE.
  
  If TheLocation.Exists = False Then
    Dim Response As Integer = MsgBox ("The ""SolarBox"" Folder doesn't exist in the Documents folder", 36)
    
    Select Case Response
    Case 6
      //User Pressed Yes
      Dim SolarBoxFolder As New FolderItem
      SolarBoxFolder = TheLocation
      SolarBoxFolder.CreateAsFolder
      MsgBox """SolarBox"" Folder Created!"
    Case 7
      
    End Select
    
  End If

I have the following code: MsgBox SolarFilesLocation. I know this is wrong, so I tried MsgBox Str(SolarFilesLocation) and I get a TypeMismatchError.

How can I MsgBox a FolderItem that is a property created via the IDE? (Insert >> Property)

Thanks,
Shane.

You want MsgBox SolarFilesLocation.NativePath :slight_smile:
MsgBox can’t present a FolderItem (your type mismatch) NativePath returns a string, which is what MsgBox can present.

[quote=83031:@Tim Parnell]You want MsgBox SolarFilesLocation.NativePath :slight_smile:
MsgBox can’t present a FolderItem (your type mismatch) NativePath returns a string, which is what MsgBox can present.[/quote]

Ah, thanks! It works perfectly :slight_smile:

Anytime!
Make sure to click “This post answered my question” so this topic gets marked as answered :slight_smile: