Paulus123
03-05-2014, 02:10 AM
Hello,
I have created a Userform with a listbox to select multiple values. What i want is to insert a file at a bookmark if i select a value. This works but now the bookmark is a placemarker, but i rather have a enclosed bookmark so if i call the userform again and change the value it will change text that is inserted.
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks("Bookmark").Range
If Listbox.Text = "one" Then
BMRange.InsertFile FileName:= _
"c:\text1.docx"
ElseIf Listbox.Text = "two" Then
BMRange.InsertFile FileName:= _
"c:\text2.docx"
Could someone help me?
Thanks in advance.
I have created a Userform with a listbox to select multiple values. What i want is to insert a file at a bookmark if i select a value. This works but now the bookmark is a placemarker, but i rather have a enclosed bookmark so if i call the userform again and change the value it will change text that is inserted.
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks("Bookmark").Range
If Listbox.Text = "one" Then
BMRange.InsertFile FileName:= _
"c:\text1.docx"
ElseIf Listbox.Text = "two" Then
BMRange.InsertFile FileName:= _
"c:\text2.docx"
Could someone help me?
Thanks in advance.