#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |