Inserting photos into a report at a fixed size.

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
*******************************************
 
D

Doug Robbins - Word MVP

Try setting the page up as a four row, two column table with the cell
dimensions set at those that you require. If you then insert the photos
into the left hand cells of the table, they should conform to the size of
the cell.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
B

BRC

Try setting the page up as a four row, two column table with the cell
dimensions set at those that you require.  If you then insert the photos
into the left hand cells of the table, they should conform to the size of
the cell.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.







- Show quoted text -

Doug, thanks for the reply. I had starfted down that road but I havn't
been able to find any explanation about how to define table properties
in code. I am try to yet the macro to work in both Word 2003 and Word
2007. Using a table, the above code works in 2003 but when I try to
run it in 2007 I get an error at
With Dialogs(wdDialogFormatPicture)
When I point at the line in the vb editor the message adds "= 187"
but I can't find any reference to what this might mean except
something to do with "defining word dialogs" with a "#define"
statement. again I have no idea what that might mean and I can't find
any reference in te formums to "#define" what it means or how to use
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top