B
BRC
Hi All
I am working on a template for a report that includes photos inserted
into a page. Often there will be 4 photos in column on the left side
of the page (8.5x11) and an area to right where an explanation of the
photo can be typed. I am thinking of a macro that will insert the
photo at a specified size and perhaps a formated text box to the right
where the explanation can be typed. I have an insertpic macro but it
doesn't keep the photo at the right size and always has to be
resized. I am sure someone has solved the problem so if you could
direct me to some code that deals with this it would be greatly
appreciated. Here is what i have so far. this is for the cover photo
so the pic always goes in the same place hence the bookmarks. For the
photos in the report I would not use the bookmark functions as the
there maybe one or several photos on a page.
Thanks for any suggestions.
BRC
**********************************8
response = MsgBox("This will insert a new Photo into report, Continue?
", vbYesNo)
If response = 7 Then 'anwer is no
Exit Sub
Else
Dim r As Range
Selection.GoTo What:=wdGoToBookmark, Name:="photo"
With ActiveDocument
Set r = .Range(Start:=.Bookmarks("photo").End, _
End:=.Bookmarks("endofpic").Start)
End With
r.Select
r.Delete
If Dialogs(wdDialogInsertPicture).Show <> 0 Then
'''resizes the shape
Selection.Paragraphs(1).Range.InlineShapes(1).Select
With Dialogs(wdDialogFormatPicture)
.ScaleX = 34
.ScaleY = 34
.Execute
End With
Selection.GoTo What:=wdGoToBookmark, Name:="endofpic"
Selection.EndKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1
End If
End If
End Sub
*******************************************
I am working on a template for a report that includes photos inserted
into a page. Often there will be 4 photos in column on the left side
of the page (8.5x11) and an area to right where an explanation of the
photo can be typed. I am thinking of a macro that will insert the
photo at a specified size and perhaps a formated text box to the right
where the explanation can be typed. I have an insertpic macro but it
doesn't keep the photo at the right size and always has to be
resized. I am sure someone has solved the problem so if you could
direct me to some code that deals with this it would be greatly
appreciated. Here is what i have so far. this is for the cover photo
so the pic always goes in the same place hence the bookmarks. For the
photos in the report I would not use the bookmark functions as the
there maybe one or several photos on a page.
Thanks for any suggestions.
BRC
**********************************8
response = MsgBox("This will insert a new Photo into report, Continue?
", vbYesNo)
If response = 7 Then 'anwer is no
Exit Sub
Else
Dim r As Range
Selection.GoTo What:=wdGoToBookmark, Name:="photo"
With ActiveDocument
Set r = .Range(Start:=.Bookmarks("photo").End, _
End:=.Bookmarks("endofpic").Start)
End With
r.Select
r.Delete
If Dialogs(wdDialogInsertPicture).Show <> 0 Then
'''resizes the shape
Selection.Paragraphs(1).Range.InlineShapes(1).Select
With Dialogs(wdDialogFormatPicture)
.ScaleX = 34
.ScaleY = 34
.Execute
End With
Selection.GoTo What:=wdGoToBookmark, Name:="endofpic"
Selection.EndKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1
End If
End If
End Sub
*******************************************