Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Writing a simple macro


  • Please log in to reply

#1
batpark

batpark

    Member

  • Member
  • PipPipPip
  • 596 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

  • Topic Starter
  • Member
  • PipPipPip
  • 596 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

  • Topic Starter
  • Member
  • PipPipPip
  • 596 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

  • Topic Starter
  • Member
  • PipPipPip
  • 596 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