×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft Word Macro or Advice

Microsoft Word Macro or Advice

Microsoft Word Macro or Advice

(OP)
I am still a novice user here - I am using Windows 10 on a PC and using Microsoft Word 365. I am a retired preacher and trying to write bible studies and here is my dilemma:

The word "Lord" or "LORD" is used in the Bible quite often, of course. I have found myself typing the word "LORD" and then going back and selecting the "ORD" in the word and choosing a smaller font so that it appears with a large "L" and small "ORD", or selecting the "L" and making it bigger by about 50% so the letters "ORD" remain the size font I am typing in. I sometimes write using different fonts or different size fonts. So, what I'm asking is this: can a MACRO be made so that before I type the word lord, I would hit my MACRO or turn the MACRO on, type the word lord and it will automatically capitalize all four letters as I type them and make the first letter larger in proportion to the rest of the word (perhaps 50% larger). I would then turn off the MACRO off. I would not want the MACRO to stay on as there are of course other times when "lord" is used in all lower case or "Lord". I will also sometimes copy a Bible text from my Logos Bible Software and pasted it in my writing, but still have to select the letters and change the font size. I've been doing this for years but it does slow me down when I'm on a roll in writing and have to stop to change the way "LORD" is supposed to appear. Only a Bible student would understand the difference in the meaning of "LORD" vs. "lord." Can you help me or give me a better solution.

Thanks in advance,

Bob Lankford

RE: Microsoft Word Macro or Advice

Hi,

The LORD said unto my Lord, Sit thou at my right hand, until I make thine enemies thy footstool.

Just to be clear. In cases where the typed result is all caps, as in the translation of YHWH, you want to be able to change the capital font size of all but the leading character. But is the case of Lord you don't? I know that's how the type was set for the Schofield Reference Bible, mine from when we had BRoadway as our telephone exchange code, as written by my mother on the flyleaf.

BTW, you can SELECT the entire word and SHIFT+F3 to cycle thru sever capitalization options.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Microsoft Word Macro or Advice

How about writing a couple of Macros where (let’s say keyboard shortcut Alt-L) will place a word ‘Lord’ at the cursor, and Alt-D will place word ‘LORD’ with an ’L’ increased in size? Would that work?

CODE

Option Explicit

Sub Lord()
' Lord Macro
    Selection.TypeText Text:="Lord"
End Sub

Sub Macro1()
' Macro1 Macro
    With Selection
        .TypeText Text:="LORD"
        .MoveLeft Unit:=wdCharacter, Count:=3
        .MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
        With .Font
            .Grow
            .Grow
            .Grow
            .Grow
            .Grow
        End With
        .MoveRight Unit:=wdCharacter, Count:=4
    End With
End Sub 


---- Andy

There is a great need for a sarcasm font.

RE: Microsoft Word Macro or Advice

Have you considered using autocorrect?

RE: Microsoft Word Macro or Advice

None of this messing around with font sizes isn't at all useful. All you need is a wildcard Find/Replace, where:
Find = L[Oo][Rr][Dd]
Replace = Lord
and you set the replacement font to 'small caps'.

Or, as a macro:

CODE

Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "L[Oo][Rr][Dd]"
    .Replacement.Text = "Lord"
    .Replacement.Font.SmallCaps = True
    .Format = True
    .Forward = True
    .MatchWildcards = True
    .Wrap = wdFindStop
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub 
To limit the macro's scope to just a selected range, change 'ActiveDocument' to 'Selection'.

If you really want to increase the font size as well simply add:
.Replacement.Font.Size = 15
before:
.Format = True
where the '15' is the preferred font size.

Cheers
Paul Edstein
[MS MVP - Word]

RE: Microsoft Word Macro or Advice

(OP)
Ahhhhh, thank you all for the options. I will probably try them all to see which serves me best. As always, I get the best help here at Tek-tips. You're all amazing!

Bob

RE: Microsoft Word Macro or Advice

(OP)
Andrzejek:

I like what your Macro does, and it works fine when you open the Macro and click "Run". However, nothing happens when I use the shortcut "Alt L" or "Alt D". Am I missing something? I've even tried starting the Macro Record over and assigning the keyboard shortcut "Alt L" and "Alt D" but they still won't run the Macro. Am I forgetting something? Please advise.

Bob

RE: Microsoft Word Macro or Advice

It was always a mystery to me as to where and how Word keeps track of the keyboard shortcuts to run the macros. Hopefully somebody else, more knowledgeable, can shed some light on the subject. pc2

But what you CAN do is – in Word, start Macro Recorder, at the beginning you will be asked to provide a name for this Macro, and at the same time you may establish a keyboard shortcut to your Macro. Then do a few keystrokes, and stop the Macro Recorder. Then you can go to the code of that Macro (Alt-F11) and replace the code generated with the code I gave you between Sub Macro1 and End Sub. Then you will have your new macro with the keyboard shortcut you specified.

Give it a try, learn something new, you will love it.

You may want to see this - how to Assigning a Shortcut Key to a Macro


---- Andy

There is a great need for a sarcasm font.

RE: Microsoft Word Macro or Advice

(OP)
Andrzejek - never mind, I finally got it to work with one modification. Instead of 5 ".Grows" I changed it to only have 4 ".Grows". It is working like a charm, just as I had requested and needed it to.

Thank you so very much.

Bob

RE: Microsoft Word Macro or Advice

thumbsup2


---- Andy

There is a great need for a sarcasm font.

RE: Microsoft Word Macro or Advice

Surely all the .Grow stuff might be better replaced with the below to more consistently achieve the original request to "mak[e] it bigger by about 50%"

CODE

Font.Size = Font.Size * 1.5 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close