![]() |
|
|
Thread Tools | Display Modes |
#6
|
|||
|
|||
![]()
In UserForm
Option Explicit Private Sub CommandButton1_Click() Dim filename As String ' change "d:\sample.pdf" to the name of an existing file, np. "C:\Users\Tee\Downloads\XYZ.pdf" filename = "d:\sample.pdf" WebBrowser1.Navigate filename MsgBox "Done" End Sub Private Sub CommandButton2_Click() Dim filename As String ' first select - select one item in ListBox1, only then click CommandButton2 filename = ListBox1.List(ListBox1.ListIndex) ' selected item in ListBox1 WebBrowser1.Navigate filename End Sub Private Sub UserForm_Initialize() 'Dim MyFolder As String 'Dim MyFile As String 'Dim j As Integer ' MyFolder = "C:\Users\Tee\Downloads" ' MyFile = Dir(MyFolder & "\*.pdf") ' Do While MyFile <> "" ' ListBox1.AddItem MyFile ' MyFile = Dir ' Loop End Sub |
Tags |
ms word vba, pdf in webbrowser control, word user form |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toggling control checkboxes to true when a value in a control drop down is selected | ccamm | Word VBA | 4 | 03-16-2024 06:44 AM |
MsgBox launch when a Check Box Content Control is clicked | wolfgrrl | Word VBA | 1 | 06-21-2019 12:13 PM |
![]() |
DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
![]() |
marksm33 | Word VBA | 3 | 01-15-2015 07:55 PM |
![]() |
marksm33 | Word VBA | 3 | 01-15-2015 05:59 PM |