Very simple "change case" macro - why won't it work?

B

Bert Coules

I'm trying to create a very simple macro in Word 2000, to change blocked
text to all upper case.

Firstly, I assign the macro to key f9. Then I record these keystrokes:

Alt+0
Alt+E
Alt+U
Return

The macro appears to record with no problems. But if I then block some text
and press f9, all that happens is that the cursor moves up the page: no case
change occurs at all.

What am I doing wrong, please?

Many thanks.

Bert
 
D

DeanH

Have you tried using the built-in icon?
This can be found under Tools, Customise, Commands tab, Format category,
Change Case, drag "Change Case" on to the toolbar.
Also Shft+F3 toggles between the Case settings, also remember that this
toggle is repeatable wiht the F4 button.
Also F9 is by defualt the "Update Fields" command.
Hope this helps
DeanH
 
B

Bert Coules

DeanH,

Thanks for those suggestions; I'll play around with them and see what
happens.

But I'm baffled as to why the macro doesn't seem to work!

Ber
 
G

Graham Mayor

Copy and paste the code you have created into a reply to this thread so we
can see what you have done
You should have something like

Sub Ucase()
Selection.Range.Case = wdUpperCase
End Sub

http://www.gmayor.com/installing_macro.htm

I would urge you to use a different keyboard shortcut from F9, which has the
important function of updating fields.or as DeanH has suggested simply
forget the macro and use Shift+F3 to toggle between the various case modes.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bert Coules

Graham said:
Copy and paste the code you have created into a reply to this thread so we
can see what you have done...

OK. I rerecorded the keystrokes and when I checked under Macros/Edit I
found what seem to be *two* relevant entries:

**************************

Sub Macro26()
'
' Macro26 Macro
' Macro recorded 04/09/2008 by Bert Coules
'
Selection.Range.Case = wdUpperCase
End Sub
Sub Macro24()
'
' Macro24 Macro
' Macro recorded 04/09/2008 by Bert Coules
'
Selection.Range.Case = wdUpperCase
End Sub

**************************

I suppose Macro 24 is an earlier version of my attempt; I would have
expected it to have been replaced by the later one (26, presumably?) but
it's still there. I freely admnit that I have only the haziest idea of how
macros work in Word - why is there no reference in the listing to the
assigned key, for instance?
I would urge you to use a different keyboard shortcut from F9, which has
the important function of updating fields.

I make no use (at least knowingly) of fields, so I thought reusing f9 (as I
already reuse f10, 11, and 12) didn't really matter.

Bert
 
D

DeanH

Table of Contents, Captions for Table/Figure numbers, and cross references
are all Fields to name a few.
If you never have these features, then you maybe OK, but in the future this
may cause you some problems trying to refresh these without F9.
Hope this helps
DeanH
 
G

Graham Mayor

Either one of those macros should work if you have the text already
selected. You can delete the extra one and maybe rename the other to
something more meaningful. If it is not working when F9 is re-assigned to
it, it is probably that Word objects to the re-assignment. There are plenty
of uniused keyboard shortcuts that you might have chosen without using
built-in shortcuts. ALT+U would have been the obvious choice.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bert Coules

Thanks to Dean and Graham for the replies.
You can delete the extra one and maybe rename the other to something more
meaningful.

I might do that. I must find out which part of the list is the title.
If it is not working when F9 is re-assigned to it, it is probably that
Word objects to the re-assignment.

Then it should have told me so. However, I did the whole procedure again -
and now it works. I suspect that I made an error earlier in the
key-assignment bit of the process.

I take the point about altering an existing shortcut, but as I said, I have
no use for f9 as it is, and I prefer a single key press macro.

I do find the whole area of macros in Word highly confusing, though. I must
hunt up a simple guide.

Bert
 

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