Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2010, 11:00 PM
Bahir Barak Bahir Barak is offline I need a macro, who can help me? Windows XP I need a macro, who can help me? Office 2003
Novice
I need a macro, who can help me?
 
Join Date: May 2009
Posts: 11
Bahir Barak is on a distinguished road
Question I need a macro, who can help me?

Hello!

I need a macro which starts with Word, when ever I open it,


the macro should create two MS Word Documents for me in E: Drive, or the file names may be (file01.doc) and (file02.doc)
the macro should have also two shortcut keys (Cntrl + D) and (Cntrl + H)

When I am working on an MS Word Document, for example it has 300 pages, I am editing this file, that is some words which I am replacing them with some another ones,
now I want from this macro whenever I select a word and press (Cntrl + D) the selected word should automatically adds to (file01.doc) on E: Drive, and when I select a word and press (Cntrl + H) the selected word should automatically adds to (file02.doc) on E: Drive....
everyone of these words which are added to those two files (file01.doc) and (file02.doc), should be in separate row or line.
_______________________

now if the creation of two document files is a problem in macro so I will create it with these names and paths: (E:\file01.doc) and (E:\file02.doc).
Now the second part of macro is left, selecting text and adding it to those two files by pressing two keys, if they become (Cntrl + D) and (Cntrl + H) so that will be ery good, and I by myself can't do that, because I don,t have experience in VBA,
so thanks very very much fore any brother who had resolved my this problem.
thanks
Reply With Quote
  #2  
Old 05-26-2010, 12:24 AM
Steve_D Steve_D is offline I need a macro, who can help me? Mac OS X I need a macro, who can help me? Microsoft Office 2004 for Mac
Advanced Beginner
 
Join Date: Dec 2009
Posts: 59
Steve_D is on a distinguished road
Default

This is fairly straightforward using the Record Macro function. There are a few steps.
1. Create the two documents you referred to: file01.doc and file02.doc.
2. Open the document you are editing and the other two documents, so you have 3 windows open in Word.
3. With the editing document active, select a word you want to copy to file01.doc.
4. Go to Tools, Macros, Record Macro. (In newer versions of Word with the ribbon, you will need to make sure the Developer tab is showing (via Word Options), then choose Record Macro from the Developer tab.)
5. Give your macro a name with no spaces, e.g. Move_to_file01. Click OK.
6. A little recording icon will appear.
7. Use Edit, Copy or Ctrl + C to copy the selected word.
8. Use the Window menu to select file01.doc.
9. Use Edit, Paste or Ctrl + V to paste the word.
10. Hit Enter to move to a new line.
11. Use the Window menu to go back to your editing document.
12. Click the Stop button on the macro recording icon.
You have now created the first macro.

To assign it a keyboard shortcut:
1. Go to Tools, Customize and click on Keyboard.
2. Scroll down to Macros and select Move_to_file01.
3. Click in the "Press new shortcut key" box, and press Ctrl + D on your keyboard.
4. Click Assign, then OK.
You have now assigned the shortcut Ctrl + D to your macro.

Do the same for the other one.
Hope this works. It will vary depending on your version of Word but these are the basic steps.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a macro, who can help me? Help with a macro Takket Word VBA 2 03-28-2014 04:58 PM
Macro help NEHicks503 Excel 0 04-16-2010 07:29 AM
I need a macro, who can help me? Excel macro (vba) HuaMin Excel 2 03-22-2010 08:11 PM
Word macro weezypenguin Word 0 02-25-2010 01:25 PM
Macro Won't Save lou0915 Word VBA 2 10-17-2009 08:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft