Word 2007 macro to insert picture and word wrap

C

charia

Hi, When i insert a picture in a word document, i want to make a macro which
will select the picture, go to 'picture tools' -> 'format' -> 'text wrapping'
-> 'through'. But when i am recording the macro the 'arrange' portion of
'format' is all grey and i can not select anything. How do i create a macro
to do this. thanks
 
D

Doug Robbins - Word MVP

Use

Dim ashape As Shape
Set ashape = ActiveDocument.Shapes.AddPicture(FileName, LinktoFile,
SaveWithDocument, Left, Top, Width, Height, Anchor)
ashape.WrapFormat.Type = wdWrapThrough

Check out the Shapes.AddPicture method in the Visual Basic Help file for
information on all of the terms within the parentheses.
--
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
 
A

Andrew Walker

Hey everyone,

I am trying to create an email signature that pulls all it's information from Active Directory. This is working fine but I also have an image in the signature and I need to change the wrapping to 'Square'.

Basically I want all of the signature text to appear to the right of the image (which it does when set to Square).

I am currently using the below but it is not changing the wrapping..

Set objShape = objSelection.InlineShapes.AddPicture("C:\image002.jpg, LinkToFile:=False, SaveWithDocument:=True")
Set objShape = objSelection.InlineShapes(1).ConvertToShape
objShape.WrapFormat.Type = wdWrapSquare

I did manage to get this to work within Word 2007 but not with Outlook.

Any help would be greatly appreciated.

Thanks in advance



Doug Robbins - Word MVP wrote:

UseDim ashape As ShapeSet ashape = ActiveDocument.Shapes.
13-Nov-08

Use

Dim ashape As Shape
Set ashape = ActiveDocument.Shapes.AddPicture(FileName, LinktoFile,
SaveWithDocument, Left, Top, Width, Height, Anchor)
ashape.WrapFormat.Type = wdWrapThrough

Check out the Shapes.AddPicture method in the Visual Basic Help file for
information on all of the terms within the parentheses.
--
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


Previous Posts In This Thread:

On 11 November 2008 14:01
chari wrote:

Word 2007 macro to insert picture and word wrap
Hi, When i insert a picture in a word document, i want to make a macro which
will select the picture, go to 'picture tools' -> 'format' -> 'text wrapping'
-> 'through'. But when i am recording the macro the 'arrange' portion of
'format' is all grey and i can not select anything. How do i create a macro
to do this. thanks

On 13 November 2008 01:13
Doug Robbins - Word MVP wrote:

UseDim ashape As ShapeSet ashape = ActiveDocument.Shapes.
Use

Dim ashape As Shape
Set ashape = ActiveDocument.Shapes.AddPicture(FileName, LinktoFile,
SaveWithDocument, Left, Top, Width, Height, Anchor)
ashape.WrapFormat.Type = wdWrapThrough

Check out the Shapes.AddPicture method in the Visual Basic Help file for
information on all of the terms within the parentheses.
--
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


EggHeadCafe - Software Developer Portal of Choice
Build An XML-Safe DES Crypto Library in VB.NET
http://www.eggheadcafe.com/tutorial...c3-36c58ba19ec9/build-an-xmlsafe-des-cry.aspx
 
A

Andrew Walker

Hey everyone,

I am trying to create an email signature that pulls all it's information from Active Directory. This is working fine but I also have an image in the signature and I need to change the wrapping to 'Square'.

Basically I want all of the signature text to appear to the right of the image (which it does when set to Square).

I am currently using the below but it is not changing the wrapping..

Set objShape = objSelection.InlineShapes.AddPicture("C:\image002.jpg, LinkToFile:=False, SaveWithDocument:=True")
Set objShape = objSelection.InlineShapes(1).ConvertToShape
objShape.WrapFormat.Type = wdWrapSquare

I did manage to get this to work within Word 2007 but not with Outlook.

Any help would be greatly appreciated.

Thanks in advance



Doug Robbins - Word MVP wrote:

UseDim ashape As ShapeSet ashape = ActiveDocument.Shapes.
13-Nov-08

Us

Dim ashape As Shap
Set ashape = ActiveDocument.Shapes.AddPicture(FileName, LinktoFile,
SaveWithDocument, Left, Top, Width, Height, Anchor
ashape.WrapFormat.Type = wdWrapThroug

Check out the Shapes.AddPicture method in the Visual Basic Help file for
information on all of the terms within the parentheses
--
Hope this helps

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

Doug Robbins - Word MV


Previous Posts In This Thread:

On 11 November 2008 14:01
chari wrote:

Word 2007 macro to insert picture and word wrap
Hi, When i insert a picture in a word document, i want to make a macro which
will select the picture, go to 'picture tools' -> 'format' -> 'text wrapping'
-> 'through'. But when i am recording the macro the 'arrange' portion of
'format' is all grey and i can not select anything. How do i create a macro
to do this. thanks

On 13 November 2008 01:13
Doug Robbins - Word MVP wrote:

UseDim ashape As ShapeSet ashape = ActiveDocument.Shapes.
Us

Dim ashape As Shap
Set ashape = ActiveDocument.Shapes.AddPicture(FileName, LinktoFile,
SaveWithDocument, Left, Top, Width, Height, Anchor
ashape.WrapFormat.Type = wdWrapThroug

Check out the Shapes.AddPicture method in the Visual Basic Help file for
information on all of the terms within the parentheses
--
Hope this helps

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

Doug Robbins - Word MV


On 10 November 2009 02:24
Andrew Walker wrote:

Text Wrapping within Outlook 2007
Hey everyone,

I am trying to create an email signature that pulls all it's information from Active Directory. This is working fine but I also have an image in the signature and I need to change the wrapping to 'Square'.

Basically I want all of the signature text to appear to the right of the image (which it does when set to Square).

I am currently using the below but it is not changing the wrapping..

Set objShape = objSelection.InlineShapes.AddPicture("C:\image002.jpg, LinkToFile:=False, SaveWithDocument:=True")
Set objShape = objSelection.InlineShapes(1).ConvertToShape
objShape.WrapFormat.Type = wdWrapSquare

I did manage to get this to work within Word 2007 but not with Outlook.

Any help would be greatly appreciated.

Thanks in advance

EggHeadCafe - Software Developer Portal of Choice
Insert Records - XML/ADO Marshalling Over The Net
http://www.eggheadcafe.com/tutorial...bb29-621bdddd8638/insert-records--xmlado.aspx
 

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