|
| Macro Code for creating graphic shape |
 |
Mon, 31 Mar 2008 11:33:06 -040 |
I can create a macro to insert a graphics shape via the Draw Shapes toolbar,
but apparently these commands cannot be recorded. And, I want to automate
the creation.
So I'd like to create the code to do the following
Create a graphics box (at the cursor position) with default dimensions TBD
(Will put dimensions in the macro code)
Edit the box the set the outline thickness TBD (Will put dimensions in the
macro code)
Add text to the box such as "Default Text"
I've not been able to locate the proper codes to do this task. I'd like the
box to be created without my having to manually set the parameters via the
dialog box(es).
I did find the GraphicCreateBox (), and GraphicEditBox () codes, but I'm not
sure how to use these, and what codes to use for setting the parameters.
Any help here would be appreciated.
Ron Hirsch
|
| Post Reply
|
| Re: Macro Code for creating graphic shape |
 |
Mon, 31 Mar 2008 13:56:29 -050 |
Maybe one shape per file and use FileInsert()?
|
| Post Reply
|
| Re: Macro Code for creating graphic shape |
 |
Mon, 31 Mar 2008 14:25:07 -040 |
I'm also perfectly willing to use a graphics text box.
Ron Hirsch
|
| Post Reply
|
| Re: Macro Code for creating graphic shape |
 |
Mon, 31 Mar 2008 14:51:33 -040 |
Hi Roy,
I had thought of doing somethinig similar to that. But I wanted the
flexibility to just run a macro to do the work.
So, how about creating a document with the box I want. Then create a macro
which opens that doc, selects the special graphics box, which will be all
formatted as I want it, copies it to the clipboard, closes the doc, and then
pastes it into the new doc.
Once in there, I can then continue to copy and paste from the new doc.
Or if I wanted, I could actually set up several variations on the special
box, and have the macro bring up a dialog box to let me choose which one I
wanted.
I know that one can select various items in a document, such as a graphic,
and other items, and save only the selected item. A dialog box comes up that
asks re saving the selection, or the whole document. But that does not seem
to be the case for inserted shapes.
I guess I must be a glutton for punishment. :-)
NEW question - When I use the "Draw Shapes" toolbar, and I'm drawing
multi-segmented lines and arrows, I like to have those lines pure H or V.
Seems like in the past, holding the SHIFT key as one drew accomplished that,
did it not? And, I saw someplace in WP that the CTRL key would do that, but
I guess not in this case.
Ron
+++++++++++++++++++++++
"lemoto" <ctech@corel.ca> wrote in message
news:VA.00004bd9.0026383d@corel.ca...
Ron:
> I can create a macro to insert a graphics shape via the Draw Shapes
> toolbar,
> but apparently these commands cannot be recorded. And, I want to automate
> the creation.
>
> So I'd like to create the code to do the following
>
> Create a graphics box (at the cursor position) with default dimensions TBD
> (Will put dimensions in the macro code)
> Edit the box the set the outline thickness TBD (Will put dimensions in the
> macro code)
> Add text to the box such as "Default Text"
I should set up one Shape as I wish it to be, then Copy/Paste.
--
Good wishes!
Roy Lewis
C_Tech volunteer
(UK)
|
| Post Reply
|
| Re: Macro Code for creating graphic shape |
 |
Mon, 31 Mar 2008 18:23:00 -040 |
Hi Ken and Roy,
Thanks to both of you for the suggestions.
And yes Ken, the "File>Insert does seem to work OK.
I did notice something strange in my "playng". If I create a
"shape" box, it
can be copied and pasted elsewhere in a document. But once I add text to it,
it can be copied, copy is not greyed out, but the "paste" is greyed
out, and
indeed, it will not paste anywhere.
On the other hand, a regular graphics text box behaves differently. It will
copy and paste both with and without text in the box.
And, I learned that one cannot create and format a graphics shape
(rectangle, line, etc.) by recording a macro, as the creation of the box
will not record. But, if one creates a shape manually, then one can record
the steps to format it exactly as wanted, since the graphics property still
functions and does not grey out.
So since I can record all the properties I want, if I create (and have
selected) a graphics shape, that is the path I'll take. I can just create
any rectangular shape, and then click on a toolbar button to run the macro.
Also, I have been able to create a macro to insert a shape, by pasting the
code into a macro, but could not put together the code to format the box. So
I will try combining the two sets of code to do the whole job.
And, the same applies to all the arrows I want to create - create the arrow
exactly as I want it, leave it selected, and then run the arrow formatting
macro.
Ron
|
| Post Reply
|
|
|