How do I use macros to manipulate photos?

  • Thread starter Richard Sullivan, Architects Hawaii Ltd.
  • Start date
R

Richard Sullivan, Architects Hawaii Ltd.

I size, set parameters and paste photos into documents using the same set of
actions for each photo. I would like to automate this task by creating a
macro but macros does not function once I am working within the photo. Does
anyone know how to get around this?
 
D

Doug Robbins - Word MVP

You are not going to be able to record the commands that you would need. It
is possible however to create a macro to do it by entering the commands into
the Visual Basic Editor.

As and example, here's a bit of code from an application that I developed
that inserts an image and then adjusts it's size:

'Insert Logo into Section 1 Header
myDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range.Delete
myDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range.InlineShapes.AddPicture Filename:=txtLargeLogoPath
'Re-size logo
oheight =
myDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range.InlineShapes(1).Height
owidth =
myDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range.InlineShapes(1).Width
If oheight > InchesToPoints(0.68) Then
With
myDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range.InlineShapes(1)
.Height = InchesToPoints(0.68)
.Width = owidth * InchesToPoints(0.68) / oheight
End With
End If
End If


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

"Richard Sullivan, Architects Hawaii Ltd." <Richard Sullivan, Architects
Hawaii (e-mail address removed)> wrote in message
news:[email protected]...
 

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