Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Search and change automatically
Could I use Word to change this:
[g] Where have all the [em} flowers gone, [c] long time [d] passing. to having everything in and including the [ ] brackets change to bold and capitals so it would be like this: [G] Where have all the [Em} flowers gone, [C] long time [D] passing. ((but in bold, I can't seem to format that here)). I think I need to create some type of lookup table as [em] might come out [EM] and something like [d#m7] need to be [D#m7]. Right now I type everything and use a manual search and replace to do this and sometimes miss one [X] when it is a chord that changes only once and I miss searching for it. Thanks in advance for any comments/suggestions. Gene |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Search and change automatically
Assuming that [em} was an error that was meant to be [em],
The following macro will do what you want: Dim myrange As Range Dim i As Long Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(FindText:="\[[a-z]{1}", MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True Set myrange = Selection.Range myrange.End = ActiveDocument.Range.End i = InStr(myrange, "]") myrange.End = myrange.Start + i myrange.Text = "[" & UCase(myrange.Characters(2)) & Right(myrange, Len(myrange) - 2) myrange.Font.Bold = True Loop End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Gene" wrote in message ... Could I use Word to change this: [g] Where have all the [em} flowers gone, [c] long time [d] passing. to having everything in and including the [ ] brackets change to bold and capitals so it would be like this: [G] Where have all the [Em} flowers gone, [C] long time [D] passing. ((but in bold, I can't seem to format that here)). I think I need to create some type of lookup table as [em] might come out [EM] and something like [d#m7] need to be [D#m7]. Right now I type everything and use a manual search and replace to do this and sometimes miss one [X] when it is a chord that changes only once and I miss searching for it. Thanks in advance for any comments/suggestions. Gene |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Search and change automatically
Yes that was a typo error.
This macro works Fantastic. Thank you ever so much for taking the time to assist me. It is greatly appreciated and will save me from a lot of headaches when I type out my music. I'll have to study this to see how it was constructed. Might take a while as I know nothing about this 'language'. I do see that Word has a help section for this though. At first I thought of using autocorrect but that would have required adding entries for every combination I might use within those brackets. Again, your time, help and expertise is appreciated......... Gene "Doug Robbins - Word MVP" wrote in message ... Assuming that [em} was an error that was meant to be [em], The following macro will do what you want: Dim myrange As Range Dim i As Long Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(FindText:="\[[a-z]{1}", MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True Set myrange = Selection.Range myrange.End = ActiveDocument.Range.End i = InStr(myrange, "]") myrange.End = myrange.Start + i myrange.Text = "[" & UCase(myrange.Characters(2)) & Right(myrange, Len(myrange) - 2) myrange.Font.Bold = True Loop End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Gene" wrote in message ... Could I use Word to change this: [g] Where have all the [em} flowers gone, [c] long time [d] passing. to having everything in and including the [ ] brackets change to bold and capitals so it would be like this: [G] Where have all the [Em} flowers gone, [C] long time [D] passing. ((but in bold, I can't seem to format that here)). I think I need to create some type of lookup table as [em] might come out [EM] and something like [d#m7] need to be [D#m7]. Right now I type everything and use a manual search and replace to do this and sometimes miss one [X] when it is a chord that changes only once and I miss searching for it. Thanks in advance for any comments/suggestions. Gene |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically going to next changed text after accepting or reject | Microsoft Word Help | |||
Search Direction | Microsoft Word Help | |||
Search for CAPITALIZED words? | New Users | |||
How to change default direction for search and replace in Word 2002 | Microsoft Word Help | |||
Change of E-mail address change - Global Search/Replace | New Users |