S
Sharyn K
I am a transcriptionist, and my client requires the patient name to be in the
file properties Title field of each file I create. I have some code (some of
it created by me, some not) that will copy the patient name from the report
and open the correct dialog box, but I can't figure out how to get it to
paste the name in the title field. I'm no programmer and need to be pointed
in the right direction at the very least!
Also, is there a way to have the file properties dialog box open when I
click to close the file so that I can confirm that I put the patient name in
there?
Here is the code I have so far:
Sub Copyname()
'
' Copyname Macro
' Macro recorded 6/14/2007
Selection.Find.ClearFormatting
With Selection.Find
..Text = "Patient:"
..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:="$"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
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.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1
With Dialogs(wdDialogFileSummaryInfo)
..Display
MsgBox .Title
End With
End Sub
Thanks with any help you can give!
file properties Title field of each file I create. I have some code (some of
it created by me, some not) that will copy the patient name from the report
and open the correct dialog box, but I can't figure out how to get it to
paste the name in the title field. I'm no programmer and need to be pointed
in the right direction at the very least!
Also, is there a way to have the file properties dialog box open when I
click to close the file so that I can confirm that I put the patient name in
there?
Here is the code I have so far:
Sub Copyname()
'
' Copyname Macro
' Macro recorded 6/14/2007
Selection.Find.ClearFormatting
With Selection.Find
..Text = "Patient:"
..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:="$"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
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.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1
With Dialogs(wdDialogFileSummaryInfo)
..Display
MsgBox .Title
End With
End Sub
Thanks with any help you can give!