Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Excel Record Macro to Capture MS Word Operations

Status
Not open for further replies.

pradipto

Programmer
Apr 29, 2002
22
US
Hi,

The Excel Record New Macro functionality seems to record only those activities that are done within MS Excel itself.

Is it possible to extend the Excel Record New Macro functionality to include operations like opening of a word document, copying files from Excel to the word document and closing the word document etc ?

Thanks
 
Not really, but...
[ol]
[li]Create an object variable in Excel that represents a Word document,[/li][li]Set this object equal to the document you want to manipulate,[/li][li]Record a macro in Word to capture the activities you are performing in Word,[/li][li]Copy the macro commands from the Word VBE pane,[/li][li]Paste into the Excel macro in the Excel VBE pane,[/li][li]Add this newly created object to the calls from the Word Macro and,[/li][li]Voila[/li][/ol]
The macro usage between Word and Excel is a little different so to debug you may want to add a reference to the Microsoft Word x.x Object Library in the Excel VBE pane.

Hope this helps,
CMP

Not sure if this works, I only skimmed the book that came with the software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top