Recording macro

C

courtesio99

I have the following problem in recording macro.

I can't seem to be able to draw anything after i click on "Record New
Macro". Also, I also cannot select any part of the word document to go
to. Why is this so?

I really appreciate any help... thanks.
 
M

Mark Tangard

You need to click an icon the Drawing toolbar before you can draw. You can't
just click Record and then start drawing. Please read the detailed answer I
left to your prior post for more information on building shapes via code.

On your second question, you're probably trying to select part of the document
with the mouse. You can't do that while recording. Except for certain aspects
of the drawing feature, the macro recorder recognizes mouse actions only in
menus and dialogs, not in a document.
 
C

courtesio99

Thanks... I have read your reply on the other post, and I appreciate it.
But I'm still curious on how to record drawings. The drawing toolbar is
already enabled when I press record. But it still refuses to let me
draw anything. Why is that so?
 
M

Mark Tangard

Couldn't say. I can record basic drawing actions in both Word 2000 and
Word 2002 with no problem. What are the exact steps you're using? Tell
us every click or keystroke; there's probably a simple explanation.
 
C

courtesio99

Okie.. I shall list out the simple steps that I have done. The drawing
toolbar is already shown at the bottom of the page.

1) Tools -> Macro -> Record New Macro
2) The "Record Macro" window comes out and I press "Ok".
3) The "Stop Recording" toolbar is visible, and now the cursor has a
cassette tape attached to its tail.
4) I click on the one of the shapes present in the Drawing toolbar, say
a rectangle.
5) But I just couldn't draw anything on the document.
 
M

Mark Tangard

I don't know what to say here. It works fine when I try it.

Just to clarify the (I hope) obvious: You're dragging with the left
mouse button, correct? Single clicking a shape on the toolbar, then
singe-clicking and holding the button down while you drag?

On some machines there's a short delay between when you finish drawing a
shape and when the shape appears. Are you seeing the shape outline
while you drag but not (or not immediately) after you finish?

Not to mitigate the specific problem at hand, but do remember that
recording a shape, rather than writing the code to create it, gives you
far less flexibility in manipulating it via code later.
 
C

courtesio99

Thanks for replying, yes i did what you said.

I don't see the shape outline. In fact, I can't even do anything on th
document after I click on a shape on the toolbar
 
M

Mark Tangard

Do you mean you can't type in the document either after that point? If
so, this implies something is very sick.

Can you do what you're trying to do on another computer? If you can,
your problem is in your machine and not in your code.
 
C

courtesio99

I can type in the document but i can't draw. I have tried it on another
computer and it's the same thing.

Perhaps, if you are kind enough, you can tell me what are your specific
steps to record what you draw?

Of course, I'll bear in mind that writing the code is much more useful
than recording.
 
C

Charles Kenyon

You can't record mouse movements in the macro recorder (other than clicks on
menus, toolbars & buttons). I would suggest saving your drawing objects as
AutoText and calling the AutoText entries.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
M

Mark Tangard

Courtesio said:
Perhaps, if you are kind enough, you can tell me what are your
specific steps to record what you draw?

Nothing special: Tools> Macros> Record New Macro> [name it], click OK.
Select a shape from the drawing toolbar, drag, adjust, right-click it to
change attributes, etc., click Stop Recording button when done. I'm
using Word 2000. Do you have an earlier version?
You can't record mouse movements in the macro recorder (other
than clicks on menus, toolbars & buttons).

Actually you can. You can record the creation of a shape by dragging
and setting its attributes. The drawback is that it produces mountains
of code and is a shortcut to frustration if you want to do much else
with the shape afterward. I can draw a rectangle, color it, resize it,
and change the color to a gradient in about 8 clicks, but it produces
about 30 lines of code.
I would suggest saving your drawing objects as
AutoText and calling the AutoText entries.

This works fine and is the clear answer if you always want shapes with
the same attributes, position, etc. Once an AutoTexts is created, a
single line of code can insert it.

--
Mark Tangard, Microsoft Word MVP
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters




Charles said:
You can't record mouse movements in the macro recorder (other than clicks on
menus, toolbars & buttons). I would suggest saving your drawing objects as
AutoText and calling the AutoText entries.

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- --------- This message
is posted to a newsgroup. Please post replies and questions to the
newsgroup so that others can learn from my ignorance and your wisdom.
 
C

courtesio99

I'm using Word2002 but I can't record shapes though I followed you
steps and did the same thing. Is there any setting which may hav
disabled this
 
M

Mark Tangard

I can't think of one. The macro recorder doesn't have many settings
that would alter how code is recorded. (In fact, I don't it has any.)
I don't have ready access to Word 2002, but will try it on a friend's PC
later this week.
 
N

nplummer

Hi
I am able to draw shapes but only outside the drawing canvas.
here is the code that was produced

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 26/02/2004 by Nigel Plummer
'
ActiveDocument.Shapes("Canvas 3").Select 'this wouldn't draw
ActiveDocument.Shapes.AddShape(msoShapeOval, 98.25, 608.25, 115.5
119.25 _
).Select ' but this was OK
End Sub

hope that helps

Nige
 

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