General discussion

Locked

Writing a macro or code in Word

By winmorgan ·
I'd like to know if someone can tell me how to write some sort of macro or code to replace strings of characters in Word. Here's what I'm trying to deal with: A list of MP3 files which looks like this:

Track 17: Length: 03:57.69, Pause frames: 150, Filters: 0, Name: 'OBWAT - I'll fly away.mp3'.
Track 18: Length: 04:19.61, Pause frames: 150, Filters: 0, Name: 'David Lindley - Pay Bo Diddley.mp3'.
Track 19: Length: 02:09.07, Pause frames: 150, Filters: 0, Name: 'David Lindley (BrowneAlb.)-Fiddlin' Around 1975.mp3'.

I want to replace everything from "Length" through "Name:" Obviously, global search and replace won't work because the Length numbers change for each song. So...is there a way to tell Word to take everything from "Length? through ?Name:" and replace it with a single space?

Thanks for any help,

Win

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Writing a macro or code in Word

by DKlippert In reply to Writing a macro or code i ...

This works for me:

Length*e:

Put a space in front of Length and don't put anything in the replace box.
There's more wildcard info at:
www.mvps.org/word/FAQs/General/UsingWildcards.htm

Collapse -

Writing a macro or code in Word

by winmorgan In reply to Writing a macro or code i ...

Wel...I was hoping that would do it, but it doesn't work for me. I'm using Word 2000 in Microsoft Office.

I tried it just as you said, with a space in front of "length" and then *e: (so, I put _length*e (where the underscore is a space) in the find box and nothing at all in the replace box and I click Replace All and get a message that 0 replacements were made.

To be on the safe side, I then copied your text just as you gave it and pasted it into the Find box, with nothing in the Replacebox...unfortunately, same result: "0 replacements made." Any other suggestions??

Thanks,

Win

Collapse -

Writing a macro or code in Word

by DKlippert In reply to Writing a macro or code i ...

Make sure that "Use Wildcards" is checked under Search Options. (If you don't see it, click on the "More" button.)
You could make the Find look more fancy by using

( Length:) (*) (Name:)
once again using Wildcards.

Collapse -

Writing a macro or code in Word

by winmorgan In reply to Writing a macro or code i ...

DUDE!!!...as they say.

Worked like a charm. Thanks for the clarification. Once Use Wildcards was checked, it worked like a charm.

Best regards and many thanks,

Win

Collapse -

Writing a macro or code in Word

by winmorgan In reply to Writing a macro or code i ...

This question was closed by the author

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums