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 / March 2008

Tip: Looking for answers? Try searching our database.

Code to select only lines in a drawing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
XP - 10 Mar 2008 18:08 GMT
Using Office 2003 and Windows XP;

Is there a way using code (or otherwise) to quickly select only the line
drawing objects on the current page. i.e. only lines, not boxes or other
shapes?

If possible could someone please post generic example code to do this?

Thanks in advance.
Jean-Guy Marcil - 10 Mar 2008 19:44 GMT
> Using Office 2003 and Windows XP;
>
[quoted text clipped - 3 lines]
>
> If possible could someone please post generic example code to do this?

Just cycle the shape collection and select those that have a height equal to
zero.
XP - 10 Mar 2008 20:43 GMT
FYI, I was wanting to figure out how to send all lines to back and I thought
I needed an array, but then your post made me realize I could just set them
in the loop; also, I have vertical lines as well, so basing on what you
suggested I worked this out:

Private Function SendAllLinesBack()
'sends all drawing lines to back in zorder of objects:
Dim oSHP As Shape
For Each oSHP In ThisDocument.Shapes
   If (oSHP.Height = 0 Or oSHP.Width = 0) Then
       oSHP.ZOrder msoSendToBack
   End If
Next oSHP
End Function

Thanks!

> > Using Office 2003 and Windows XP;
> >
[quoted text clipped - 6 lines]
> Just cycle the shape collection and select those that have a height equal to
> zero.
Jean-Guy Marcil - 11 Mar 2008 14:22 GMT
> FYI, I was wanting to figure out how to send all lines to back and I thought
> I needed an array, but then your post made me realize I could just set them
[quoted text clipped - 10 lines]
> Next oSHP
> End Function

Glad that you worked it out!
 
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.