Applying a custom paragraph style to drawing canvasses (featuring "inline with text")

A

andreas

Below macro applies a custom paragraph style to all graphics that have
been put "inline with text". It is running fine.

Sub ApplyCustomParagraphStyleToInlineGraphics()
Dim ilsh As InlineShape
For Each ilsh In ActiveDocument.InlineShapes
ilsh.Range.Style = "CustomParagraphStyle"
Next ilsh
End Sub

I now would like to apply a custom paragraph style to all drawing
canvasses of a document that have also been preformatted to be "inline
with text". I have got no idea how to do this using VBA.

Any help is greatly appreciated. Thank you very much in advance.

Regards,

Andreas
 
G

Greg Maxey

Again very limited testing:

Sub ScratchMacro()
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
If oShp.WrapFormat.Type = wdWrapInline Then
oShp.Anchor.Style = "CustomParagraphSytle"
End If
Next
End Sub
 
A

andreas

Again very limited testing:

Sub ScratchMacro()
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
If oShp.WrapFormat.Type = wdWrapInline Then
oShp.Anchor.Style = "CustomParagraphSytle"
End If
Next
End Sub

--
Greg Maxey/Word MVP
See:http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.







- Zitierten Text anzeigen -

Greg,

Great, it is working. Again, thank you very much for your valuable
help in this forum.

Regards, Andreas
 

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