Hi Jay,
I wish I understood the Shapes and InlineShapes object collections
better
and the differences between them.
Your code works great in setting the properties correctly, however, the
picture (which is actually my signature) is placed at the top of the
document when my desire is for it to be placed on the line where the cursor
rests.
I was originally using "Selection.InlineShapes" which gave me the proper
insertion point but I wasn't able to change the desired properties. I
altered the
code to "ActiveDocument.Shapes" so that I could at least change the width
and height properties just before I posted the question to the news group
not
realizing in doing so I had lost the insertion point.
If I apply what I've learned from you and change the code back to
"Selection.InlineShapes" the ".ZOrder" and ".WrapFormat.Type" lines
return "Method or data member not found"
============================
Sub Insert_Pic()
' declare an InlineShape object variable
Dim MyShape As InlineShape
' store the pointer to the new shape
Set MyShape =
Selection.InlineShapes.AddPicture(FileName:="C:\MySignature.bmp", _
LinkToFile:=False, SaveWithDocument:=True)
' set properties of the InlineShape object
With MyShape
.Width = 160
.Height = 49
.ZOrder msoSendBehindText
.WrapFormat.Type = wdWrapNone
End With
End Sub
============================
I don't want to take too much of your time, but can the ZOrder and
WrapFormat.Type
properties be changed when using the "Selection" property and "InlineShapes"
object?
I'd also like to change Picture Position > Vertical > Absolute Position
= 0.02" below Paragraph in the code.
Thank you VERY much. Without news groups and talented people like
yourself answering questions us novice programmers would never get anything
to work.

Signature
Rick
> Hi Rick,
>
[quoted text clipped - 51 lines]
> >> procedure. Can anyone please help? Thanks.
> >> Applications.Options.PictureWrapType = wdWrapMergeBehind
Jay Freedman - 15 Jun 2005 04:11 GMT
Hi Rick,
Very briefly, an InlineShape object represents a graphic that has a
text wrapping type of "In Line With Text", while a Shape object
represents a graphic with any other wrapping type.
An InlineShape is treated like a single large character -- it's in the
text layer, it can't be dragged around the page, it moves when you
edit the text above or to the left of it, and you can't send it behind
text or in front of text (which is why those two lines in the macro
give you errors). You also can't set its absolute position, because
that's determined by the surrounding text, just as it would be for a
character.
A Shape object "floats" in a drawing layer that's either in front of
or behind the text layer. It can have a WrapFormat (square, tight,
top/bottom, none) and an absolute position.
The reason the picture in the Shape version of the macro went to the
top of the document is that you omitted the optional parameter Anchor
from the AddPicture statement. That parameter specifies the range (the
piece of document) where Word "pins" the picture; if you don't specify
it, Word assumes the beginning of the document.
Covering all those bases, here's a version that should work for you.
Sub Insert_Pic()
' declare an InlineShape object variable
Dim MyShape As Shape
' store the pointer to the new shape
Set MyShape = ActiveDocument.Shapes.AddPicture( _
FileName:="C:\MySignature.bmp", _
LinkToFile:=False, SaveWithDocument:=True, _
Anchor:=Selection.Range)
' set properties of the Shape object
With MyShape
.Width = 160
.Height = 49
.ZOrder msoSendBehindText
.WrapFormat.Type = wdWrapNone
.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionCharacter
.RelativeVerticalPosition = _
wdRelativeVerticalPositionParagraph
.Left = 0
.Top = InchesToPoints(0.02)
End With
End Sub
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
>Hi Jay,
>
[quoted text clipped - 50 lines]
>yourself answering questions us novice programmers would never get anything
>to work.