record new macro not working as expedted in word 2003

K

Keith G Hicks

I often need to do automation things with word in ms access. I usually just
record a macro in word so I can see what code I need. I just rencently
installed office 03. When I click "record new macro" all I can do is type
text on a document or choose a few of the buttons in the toolbar like
"table". I can't do severarl thigns I'm used to being able to do like adding
a text box to a document. Why is the macro recording limiting me to what I
can do? Is there a setting that will fix this?

Keith
 
K

Keith G Hicks

I get this stupid pointer with a cassette icon next to it and can't click
anywhere in my document when record is on. So I can choose a text box from
my tool bar but I can't place it anywhere on the doc.

Oh, and why when you choose a text box do you get a text box inside of a
drawing canvas thing now??????? If I just want a text box I hvae to ctrl+x
the text box, delete the canvas and then ctrl+V the box back in. What are
they doing to this tool anyway???

Keith
 
D

Doug Robbins

To turn off the automatic insertion of the drawing canvas, select Options
from the Tools menu and uncheck the "Automatically create drawing canvas
when inserting AutoShapes" item on the General tab.

As you have discovered, the macro recorder is not a satisfactory way of
trying to create macros.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
J

Jezebel

Word's macro recorder has never been able to handle mouse actions within the
document itself.
 
W

Word Heretic

G'day Keith,

Macros are a very poor way of developing code. At best, use them to
find out a few commands and then read up on those in the VBA help
system.

In your case, when you record inserting a text box, we get code that
looks like this:

ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal,93.25, _
90#, 146.5, 105.55).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse

Hey look, a TextBox is actually a type of Shape and belongs in a
Shapes collection. Sweet, that means I can use

Selection.Shapes(1).Range.TypeText

or whatever to type into that text box. Admittedly it takes a bit of
learning to understand what methods do what and what the objects are.
If needed, I have a graphical depiction of the Word Object Model in my
VBA Beginner's book, available for a small fee from
www.wordheretic.com.

As for the 'what are MS doing to gfx anyway' question, the drawing
canvas finally gives us a pseudo page dependant drawing area. Old
versions of Word are notorious for repositioning floating gfx at will
in large documents. MS hope to overcome this with the new canvas
feature. I havent used it much, but it does appear to provide more
stable results. I discuss that in my Word Spellbook.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)
 
K

Keith G Hicks

I'm sure you mean well, but you ought to take a lesson from "Peter Hewett"
when replying to posts. He's very friendly and helpful. It's really
frustrating when people answering posts try to make less knowledgable people
feel inferior. Not much point to that. Just a suggestion.
 
J

Jezebel

What a strange post. What do you see in Steve's post to take exception to?
He's absolutely right about recording macros being a disastrous method.
 
C

Chris

For what it's worth, I think Macros are a fabulous way of finding the code
you want. Why type it all in when the recorder does it for you. Yes, I
agree that sometimes you have to edit what is recorded. But for we folks
(definately me) who aren't interested in learning VBA as a second language
(and it IS a whole other language) using the recorder works just fine.

I make my macros into buttons and use them often. I have learnt to forgive
Microsoft for making me use the menus to get where I want to go when I'm
recording them (All hail Ctrl+F, H and G). But then I'll go an edit the
macro and copy and paste bits from one macro to another just to tidy things
up.

Keith, I think Steve was just trying to show you some of the stuff in
behind. I didn't get any sense of a superiority complex when I read it
(although it felt like an advert by the end of it).

I spent 5 hours last night just trying to find a bit of code to change a
date format (sadly, it wasn't the current date, coz that stuff I knew about),
so I'm no great fan of manually writing macros. But its good to know there
are folks out there who have the knowledge when I need it.

Keep playing with the macros Keith!

Cheers

Chris
 

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