Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Gene
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Doug Robbins - Word MVP
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Gene
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically going to next changed text after accepting or reject EBK Microsoft Word Help 1 September 8th 05 05:25 PM
Search Direction Diana Microsoft Word Help 1 August 16th 05 12:24 AM
Search for CAPITALIZED words? Pop New Users 2 April 11th 05 09:53 PM
How to change default direction for search and replace in Word 2002 Vilis Nams Microsoft Word Help 1 March 22nd 05 08:28 PM
Change of E-mail address change - Global Search/Replace Janet New Users 1 January 11th 05 08:28 PM


All times are GMT +1. The time now is 12:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"