Re: AutoShapes on User Forms
From: Jay Freedman (jay.freedman_at_verizon.net)
Date: 11/10/04
- Next message: Iroel Perez: "Q: Hidden Text Bounds.."
- Previous message: Trent: "Creating custom form to select info that will print separately"
- In reply to: Al Borges: "Re: AutoShapes on User Forms"
- Next in thread: Al Borges MD: "Re: AutoShapes on User Forms"
- Reply: Al Borges MD: "Re: AutoShapes on User Forms"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 10:39:32 -0500
Hi Al,
That code draws AutoShapes on the active document, but the original question
was about drawing them on a UserForm -- that's a whole different issue. If
you come across some reference to how to do that, please let us know!
-- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org > Hi Guys: > > Actually, you CAN draw autoshapes- I would have answered differently > 48 hours ago, but after rifling though a neat, small MS Word book I > just purchased called "Writing Word Macros" by O'Reilly, they > dedicated a whole chapter to this issue. In fact, you can even > animate the damn things... very cool! > > You have to go towards the back of the book, to appendix B: The Shape > Object. Here is a sample code where you would draw 2 shapes, shSquare > (a dark square) and shRect (a shaded rectangle): > > Dim shSquare As Shape > Dim shRect As Shape > Dim rng As Range > > Set rng = Selection.Range > Set shSquare = ActiveDocuments.Shapes.AddShape(msoShapeRectangle, 0, > 0, 72, 72, rng) > Set shRect = ActiveDocuments.Shapes.AddShape(msoShapeRectangle, 0, 0, > 144, 36, rng) > > shSquare.Fill.ForeColor.RGB = RGB(196, 196, 196) > shRect.Fill.ForeColor.RGB = RGB(216, 216, 216) > > etc etc etc > > You can create shapes, and also work directly with autoshapes- they > list over 100 MsoAutoShapeType constants that support this method. > > If you use the "delay" method you can then turn the autoshaps into an > animated show. > > Regards, > AL > > > "JBNewsGroup" <jerrybemail-newsgroup@yahoo.com> wrote in message > news:eOe9WaEwEHA.1308@TK2MSFTNGP09.phx.gbl... >> Hi Jay, >> >> Thanks for your reply. I was assuming that one had to be tricky, but >> you never know. No sense re-inventing the wheel. Right now I am >> starting to play around with drawing the shape in the document and >> then using clipboard to cut and paste. I did find an API for >> drawing polygons, but, I am not sure if its worth the effort, or >> even if it would work (have to read some more). >> >> Once again thanks. >> >> Jerry Bodoff >> >> >> "Jay Freedman" <jay.freedman@verizon.net> wrote in message >> news:eTTqdFDwEHA.1400@TK2MSFTNGP11.phx.gbl... >>> Hi Jerry, >>> >>> In the absence of any positive replies, I'll stick my neck out and >>> say no, it isn't possible. You might be able to fake something with >>> an Image control and a batch of pre-drawn bitmaps that you read >>> from disk. >>> >>> -- >>> Regards, >>> Jay Freedman >>> Microsoft Word MVP FAQ: http://word.mvps.org >>> >>> JBNewsGroup wrote: >>>> Hi, >>>> >>>> I am using WORD 2000 and I have a question about AutoShapes. >>>> >>>> Is it at all possible to "draw" AutoShapes on a user form? If >>>> API's are required to do this that is acceptable. What I would >>>> like to accomplish is a type of "preview frame" to show the user >>>> what is being drawn based on his selection of shape parameters. >>>> At the present I only have 4 shapes; rectangle, triangle, diamond >>>> and circle ( there may be others in the future). >>>> >>>> Thanks in advance for any help or tips. >>>> >>>> Jerry Bodoff
- Next message: Iroel Perez: "Q: Hidden Text Bounds.."
- Previous message: Trent: "Creating custom form to select info that will print separately"
- In reply to: Al Borges: "Re: AutoShapes on User Forms"
- Next in thread: Al Borges MD: "Re: AutoShapes on User Forms"
- Reply: Al Borges MD: "Re: AutoShapes on User Forms"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|