Code: Select all
Dim strBookmark As String
strBookmark = InputBox("To insert a photo, enter photo location number below, then press OK", "Inspection Photos")
If Not ActiveDocument.Bookmarks.Exists(strBookmark) Then
End If
Set rng = ActiveDocument.Bookmarks(strBookmark).Range
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect ""
End If
With Dialogs(wdDialogInsertPicture)
.Display
If .Name <> "" Then
sFileName = .Name
Set ilImage = ActiveDocument.InlineShapes.AddPicture(sFileName, , True, rng)
With ilImage
.Height = Application.InchesToPoints(1.35)
.Width = Application.InchesToPoints(1.5)
End With
End If
End With
ActiveDocument.Protect wdAllowOnlyFormFields, True, ""
ActiveDocument.Bookmarks(strBookmark).Select
Code: Select all
Set rng = ActiveDocument.Bookmarks(strBookmark).Range