Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andreas - 21 Apr 2007 10:15 GMT
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
Greg Maxey - 21 Apr 2007 13:47 GMT
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

Signature

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

> Below macro applies a custom paragraph style to all graphics that have
> been put "inline with text". It is running fine.
[quoted text clipped - 15 lines]
>
> Andreas
andreas - 22 Apr 2007 10:28 GMT
> Again very limited testing:
>
[quoted text clipped - 33 lines]
>
> - Zitierten Text anzeigen -

Greg,

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

Regards,  Andreas
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.