word wrap

Y

Yve Ke

Hi

Is there some way to insert a word art (or graphic) in a macro procedure and
get it to wrap - the wrapping is the bit i don't seem to be able to get it to
wrap - the options in the toolbar are dimmed.

Thanks for your help

Yve
 
J

Jezebel

If the wrap options are dimmed, the graphic is inline rather than floating.
If you're inserting the graphic from VBA, make sure it's going into the
Shapes collection, not InlineShapes.
 
J

Jay Freedman

The fact that all those wrapping choices are on the same button in the
toolbar is deceiving. When you deal with graphics in VBA, you need to
know that there are two completely separate collections of objects to
represent graphics: ActiveDocument.InlineShapes contains all the
in-line graphics, and ActiveDocument.Shapes contains all the floating
(wrapped) graphics.

You can use separate statements for inserting the two kinds to begin
with,

ActiveDocument.InlineShapes.AddPicture FileName:="c:\blah.jpg"

and

ActiveDocument.Shapes.AddPicture FileName:="c:\blah.jpg"

(each of which has numerous optional parameters to control position in
the document).

Alternatively, you can insert an InlineShape and then convert it to a
shape and format it with a series of statements like

Dim myShape As Shape
Set myShape = ActiveDocument.InlineShapes(1).ConvertToShape
With myShape
.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
.Top = 36 ' measured in points
.Left = 72
.WrapFormat.Type = wdWrapSquare
End With

Look in the VBA help for all these terms, plus the definitions of the
properties and methods that apply to InlineShape and Shape objects.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Y

Yve Ke

Hi Jay
I quickly created a macro below and as you can see it has inserted a
clipart, but how can i change the code so that it will wrap... .. just
removing the "Inline" didn't work... thanks in anticipation..

Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\Staff\Local Settings\Temporary Internet
Files\Content.IE5\RMZRVE6M\MCj04112920000[1].wmf" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
 
J

Jean-Guy Marcil

Yve Ke was telling us:
Yve Ke nous racontait que :
Hi Jay
I quickly created a macro below and as you can see it has inserted a
clipart, but how can i change the code so that it will wrap... .. just
removing the "Inline" didn't work... thanks in anticipation..

Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\Staff\Local Settings\Temporary
Internet Files\Content.IE5\RMZRVE6M\MCj04112920000[1].wmf" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

Try this:

ActiveDocument.Shapes.AddPicture FileName:= _
"C:\Documents and Settings\Staff\Local Settings\Temporary Internet
Files\Content.IE5\RMZRVE6M\MCj04112920000[1].wmf" _
, LinkToFile:=False, SaveWithDocument:=True, Anchor:=Selection.Range

See the online help for AddPicture (where you would have found your answer)
for more info (Select "AddPicture" in the VBA editor and hit F1).


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
Y

Yve Ke

Thank you --- yes it works !!!!

Yvonne

Jean-Guy Marcil said:
Yve Ke was telling us:
Yve Ke nous racontait que :
Hi Jay
I quickly created a macro below and as you can see it has inserted a
clipart, but how can i change the code so that it will wrap... .. just
removing the "Inline" didn't work... thanks in anticipation..

Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\Staff\Local Settings\Temporary
Internet Files\Content.IE5\RMZRVE6M\MCj04112920000[1].wmf" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

Try this:

ActiveDocument.Shapes.AddPicture FileName:= _
"C:\Documents and Settings\Staff\Local Settings\Temporary Internet
Files\Content.IE5\RMZRVE6M\MCj04112920000[1].wmf" _
, LinkToFile:=False, SaveWithDocument:=True, Anchor:=Selection.Range

See the online help for AddPicture (where you would have found your answer)
for more info (Select "AddPicture" in the VBA editor and hit F1).


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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