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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Macros- using copied text in macro

Status
Not open for further replies.

s0ccerdude

Technical User
Jul 2, 2003
38
US
I'm trying to build a macro that will arrange my data into one space-delimited column to be imported into MS Excel. In order to clean up the data, I'm using the search and replace function extensively to remove spacing, insert paragraph marks, etc.

This macro will be applied to over 2000 documents. These documents are each saved with a unique filename that will be used to identify the data once it is imported into a database.

Here's what the data should ultimately look like:

"filename" "Y or N" "name"
"filename" "Y or N" "name"
"filename" "Y or N" "name"

etc. where the data after the filename is either Y or N.

In using the macro, I'm able to insert the document's filename (Insert, AutoText, Header/Footer, Filename). But then I want the macro to search and replace with that copied filename.

Can a macro be written to copy data to the clipboard (i.e. in this case the filename) and then search and replace by using that copied data? Since the filename changes for each document, the data used to search and replace will change each time as well.

Does anyone understand what I'm trying to get at?!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top