Macro to copy and paste filename

Microsoft Office 2007 small business wit...
September 25, 2010 at 17:26:41
Specs: Windows XP
I have several hundreds of files to process. Each of them contains the following line
Filename is ABCDE.
I need to replace the ABCDE string with the actual filename.
Is there a macro I could use to copy the filename, search for ABCDE and replace with the filename?
Thank you kindly.

See More: Macro to copy and paste filename

Report •

September 25, 2010 at 21:49:15
Is ABCDE located in the same place in every file?

If so, do you know where it is or do you really have to search for it?

If you have to search for it, do you even know which sheet it's on or do you have to search every sheet?

re: "the actual filename"

Does that mean just the filename or does it mean the full path along with the filename? can't write to a closed file, so the code is going to have to open it, change the string, save it and close it. The files don't have to be visible, but opening, saving and closing "several hundreds of files" is going to take some time.

Report •

September 26, 2010 at 13:51:21

Thank you for your reply. I am sorry I did not mention I was dealing with Word 2007 documents.
These documents contain sentences that will eventually (when cleaned up and flagged) end up in a translation memory/database.

Example: the docx is called "Tourism is New York". It contains roughly 80 pair sentences as shown in the example below.

<EN>We were offered free ticket to a concert.
<FR>Nous avons re├žu des billets gratuits pour un concert.
<Pair comes from: ABCDE>

I am looking for an easy way to get to the filename (Tourism in New York), copy it, then run Search "ABCDE" and replace with "Tourism in New York", then close the S+R window. (It is just the filename, not the whole path).

Thank you.

Report •
Related Solutions

Ask Question