Something like this should do. Change "Password" to your document password:
Code:
Option Explicit
Private Sub CommandButton2_Click()
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Title = "Select the File that you want to insert"
If .Show = True Then
FiletoInsert = .SelectedItems(1)
Else
Exit Sub
End If
End With
UnProt "Password"
Application.Selection.InlineShapes.AddOLEObject _
FileName:=FiletoInsert, _
LinkToFile:=False, _
DisplayAsIcon:=True, _
IconLabel:=Right(FiletoInsert, Len(FiletoInsert) - InStrRev(FiletoInsert, "\"))
Prot "Password"
End Sub
Sub Prot(strPW As String)
'A basic Word macro coded by Greg Maxey
ActiveDocument.Protect wdAllowOnlyFormFields, True, strPW
End Sub
Sub UnProt(strPW As String)
'A basic Word macro coded by Greg Maxey
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect strPW
End If
End Sub