Save File Dialog

oralb5
10-14-2004, 11:55 AM
All - I have a windows application. I currently use a web browser object to display any documents necessary (PDF, Excel, Word, HTML, etc.). I want to allow the users to save the Excel files onto their hard drive from the network. I am having issues with the savefiledialog in that it saves a blank excel file. Can anybody see what I am doing wrong below? Any help would be appreciated. Thanks.


Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim intidx As Integer = doc.LastIndexOf("\")
Dim name As String = doc.Substring(intidx + 1)
Dim sfd As New SaveFileDialog
With sfd
.Filter = "Excel Files|*.xls"
.InitialDirectory = "C:\Documents and Settings\" _
& getusername() & "\Desktop"
.AddExtension = True
.OverwritePrompt = True
.FileName = name
.ShowDialog()
Dim fs As System.IO.FileStream = CType _
(sfd.OpenFile(), System.IO.FileStream)
End With
End Sub

MKoslof
10-15-2004, 05:27 PM
What is the value of:

doc.Substring(intidx + 1)

If you send this to the console or throw a message box, what is returned to you?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum