
adding variable in document.add line
I'm using a listbox to show all templates in a directory
and want the user to be able to double click an item in
the listbox (i.e. the desired template), which then opens.
I'm recording the value of the selected listbox item into
a variable and want to insert that variable in the
document.add line. I just don't know the exact way to do
it. Who can help?! Thanks!
The Code:
Private Sub ListBox1_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)
Dim selected As String
selected = ListBox1.Value
Documents.Add Template:="\\SERVER01\templates\[place where
the 'selected'-variable should go]", _
NewTemplate:=False, DocumentType:=0
End Sub