Below is my macro. I am looking to see is I can change the part of the macro
where I add the patient's name 3 times into one step.
It would also be nice to be able to take the doctor's last name (from where
I enter the full name) and have it pasted to the place where I type in just
the doctor's last name.
Sub CL()
'
' CL Macro
'
'
Documents.Open FileName:="C:\Documents and Settings\Administrator\My
Documents\A Doctor Letter.doc", ConfirmConversions:= _
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=InputBox(Prompt:="Type patient's name:",
Title:="Patient Name", Default:="")
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=InputBox(Prompt:="Type patient's name:",
Title:="Patient Name", Default:="")
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=InputBox(Prompt:="Type patient's name:",
Title:="Patient Name", Default:="")
Selection.MoveUp Unit:=wdScreen, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Dr."
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=InputBox(Prompt:="Type doctor's last name:",
Title:="Doctor's Last Name", Default:="")
Selection.MoveUp Unit:=wdLine, Count:=2
Selection.TypeText Text:=InputBox(Prompt:="Type Doctor's Full Name
name:", Title:="Doctor's Full Name", Default:="")
Selection.TypeParagraph
Selection.TypeText Text:=InputBox(Prompt:="Type street address:",
Title:="Street address", Default:="")
Selection.TypeParagraph
Selection.TypeText Text:=InputBox(Prompt:="Type city,state,zip:",
Title:="city,state,zip", Default:="")
Selection.Find.ClearFormatting
With Selection.Find
.Text = "#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=InputBox(Prompt:="Type patient's age:",
Title:="Patient age", Default:="")
Selection.Find.ClearFormatting
With Selection.Find
.Text = "#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=InputBox(Prompt:="Type patient's race/sex:",
Title:="Patient race/sex", Default:="")
Selection.Find.ClearFormatting
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=" "
End Sub