Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2. If True Then
  3. If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
  4. FolderName = openFileDialog1.FileName
  5.  
  6. TextBox1.Text = FolderName
  7. End If
  8. End If
  9.  
  10. End Sub
  11.  
  12. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  13.  
  14. If True Then
  15. Dim fullpath As String = System.IO.Path.GetDirectoryName(FolderName)
  16. Dim fileExist As Boolean = Directory.EnumerateFiles(fullpath, "*.pdf").Any()
  17.  
  18. Dim PdfFile As String = (fullpath & Convert.ToString("D:PDF FILES")) + TextBox2.Text + ".pdf"
  19.  
  20. If File.Exists(PdfFile) Then
  21. System.Diagnostics.Process.Start(PdfFile)
  22. Else
  23. MessageBox.Show("File is Not present ")
  24. End If
  25.  
  26. End If
  27.  
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement