Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Writing a simple macro


  • Please log in to reply

#1
batpark

batpark

    Member 1K

  • Member
  • PipPipPipPip
  • 1,064 posts
My daughter needs a simple WORD2007 macro, one that will type out a set of words ("Words to be typed out.") at the press of one key. Can this be done in WORD2007? If so, would someone please show me how? I have not been able to navigate the WORD Help screens. Thanks much. .... Batpark
  • 0

Advertisements


#2
dm27

dm27

    Member

  • Member
  • PipPipPip
  • 272 posts
Hello Batpark,

This is late reply.. However, if you are comfortable with it, you could us the Macro recorder within Word to record the text you want to type and set the short cut key(s).


If you need a hand with this, just let me know...


dm
  • 0

#3
batpark

batpark

    Member 1K

  • Topic Starter
  • Member
  • PipPipPipPip
  • 1,064 posts

Hello Batpark,

This is late reply.. However, if you are comfortable with it, you could us the Macro recorder within Word to record the text you want to type and set the short cut key(s).


If you need a hand with this, just let me know...


dm







dm27 -- Thanks for your note; and please excuse this tardy response (my monitor went bad and I was out of business until I just got a replacement). I certainly would appreciate your personal help here. I have not been successful myself in getting all the steps right. (This application is so basic I wonder why MS hasn't included the capability in XP; maybe it has and I just don't know it ?)

Again, what I want: I want to be able to use one entry (say Alt+k) to insert this text [Please cite references here.] into a WORD 2003 document. And I want the insert to be highlighted in yellow.

Thanks for your help.
  • 0

#4
Joker1337

Joker1337

    Member

  • Member
  • PipPip
  • 22 posts
The easiet way to do it is by using the marco recorder. You would:

1. Start the recorder, you assign a shortcut key and macro name here.
2. Switch formats to yellow and whatever other text effects you want.
3. Type exactly the text you want entered.
4. Stop the recorder.

I'd advise against moving the cursor during this procedure. If you can read V-Basic, you could bring the code for the macro up afterwards by Alt+F11 and modify it if you like.
  • 0

#5
dm27

dm27

    Member

  • Member
  • PipPipPip
  • 272 posts
Hi batpark,

What Joker1337 provided is an excellent method to create the macro you are seeking. Are you working with Word 2003 or Word 2007? Your posts refer to both so I'm not sure which version you have.

If it's 2003 you may find having the Visual Basic Toolbar visible while you go through the steps.

Best regards,

dm
  • 0

#6
batpark

batpark

    Member 1K

  • Topic Starter
  • Member
  • PipPipPipPip
  • 1,064 posts
dm, Joker 1337

With your encouragement I tried Macro Recording again and this time was (almost fully) successful.

This my "Macro 6". Whenever I strike Alt+z the string "Please show citations." is inserted.

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 8/24/2010 by xxxxxx
'
Selection.TypeText Text:="Please show citations."
End Sub

It works fine. But how can I get the inserted string to appear highlighted in yellow?






What Joker1337 provided is an excellent method to create the macro you are seeking. Are you working with Word 2003 or Word 2007? Your posts refer to both so I'm not sure which version you have.

If it's 2003 you may find having the Visual Basic Toolbar visible while you go through the steps.

Best regards,

dm
[/quote]
  • 0

#7
dm27

dm27

    Member

  • Member
  • PipPipPip
  • 272 posts
Greetings Batpark,

Glad to see you made some progress.

You could record a new macro where you start out with defining the highlighted color. Using the macro recorder to find the correct code, it would look like this when your done:

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 8/24/2010 by xxxxxx
'
Options.DefaultHighlightColorIndex = wdYellow
Selection.TypeText Text:="Please show citations."
End Sub


Of course, you could edit your existing code by adding the bolded line above to your macro.

Sincerely,

dm
  • 0

#8
batpark

batpark

    Member 1K

  • Topic Starter
  • Member
  • PipPipPipPip
  • 1,064 posts
dm, Joker: I am empowered! I got my macro to work fine. Thanks a million for your help. I never would have done it without you.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP