Make my TitleCase macro emulate the Format Painter

M

Marceepoo

I made a macro (shown below) that changes the case of selected text to
Title Case. The macro works just fine, except when the document has 10 or 20
or more snippets of text, on which I want to use the macro. It becomes a
pain to keep having to go back to the button I put on the toolbar (to invoke
the macro).
Does anyone know if there's a way in Vba to emulate the Format Painter,
in the sense that you can click on Format Painter in such a way as to change
the cursor, so that you can apply the formatting to one snippet of text after
the other, ad infinitum?

Any ideas would be much appreciated.
Thanks, marceepoo

Sub TitleCase()
'
' TitleCase Macro
'
Selection.Extend
Selection.Range.Case = wdTitleWord
End Sub
 
B

Bear

Marceepoo:

You could assign a keyboard shortcut to your macro so that you could just
press, say Alt+T to run your macro.

Bear
 

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