Chuck,
Which OS are you on?
Does "C:\My Documents" actually exist?
I normally use code similar to:
Dim dialog As New SaveFileDialog
dialog.InitialDirectory =
Environment.GetFolderPath(Environment.SpecialFolde r.Personal)
dialog.RestoreDirectory = True
dialog.Filter = "My files(*.my)|*.my|All files (*.*)|*.*"
dialog.FilterIndex = 1
dialog.DefaultExt = "my"
If dialog.ShowDialog() = DialogResult.OK Then
Dim stream As Stream = dialog.OpenFile()
Serialize(stream, document)
stream.Close()
End If
Which will set the initial directory to the "My Documents" folder for the
current user independent of the OS version.
Hope this helps
Jay
"Chuck" <an*******@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
Does anybody know how to set the InitialDirectory Property for Open or
SaveFileDialog? Nothing I do seems to open either in the directory I
specify. If I'm way off here does anybody know how to open these dialogs to
display a specific directory?
Here's the code I'm using for the InitialDirectory specification. I've
also tried specifying this in the SaveFileDialog1 property window.
Dim SaveFileDialog1 As New SaveFileDialog
SaveFileDialog1.InitialDirectory = "c:\My Documents"
Any help would be appreciated.
Thanks