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

Re: word wrap by Jezebel

Jezebel
Tue Jul 11 18:40:14 CDT 2006

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.




"Yve Ke" <YveKe@discussions.microsoft.com> wrote in message
news:60A785CE-E36A-4F4E-85AE-24F399A1E1AC@microsoft.com...
> 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



Re: word wrap by Jay

Jay
Tue Jul 11 19:10:36 CDT 2006

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 FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Tue, 11 Jul 2006 16:08:01 -0700, Yve Ke
<YveKe@discussions.microsoft.com> wrote:

>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

Re: word wrap by YveKe

YveKe
Tue Jul 11 19:41:01 CDT 2006

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

"Jay Freedman" wrote:

> 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 FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.
>
> On Tue, 11 Jul 2006 16:08:01 -0700, Yve Ke
> <YveKe@discussions.microsoft.com> wrote:
>
> >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
>

Re: word wrap by Jean-Guy

Jean-Guy
Tue Jul 11 20:38:53 CDT 2006

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
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: word wrap by YveKe

YveKe
Tue Jul 11 21:29:01 CDT 2006

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

Yvonne

"Jean-Guy Marcil" wrote:

> 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
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
>
>
>