I have a vast number of job applications where I am copying and pasting from a "print view" from a web browser into a MS Word document, which produces a document with lots of tables and nested tables, Somewhere in there is the name of the applicant... I can record a macro to find their name, since it'll always be in the same table/cell location, but I would like to have it Save As the name of the applicant as well. I can't seem to do that second part by just recording a macro.
Sub testing()
'
' testing Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Name:"
.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:=wdCell
Selection.Copy
so far so good, but then I'm having problems with this part because it wants to save everything as "John Smith.doc" every time.
ChangeFileOpenDirectory "C:\Users\fogharty\Desktop\"
ActiveDocument.SaveAs2 FileName:="John Smith.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=0
End Sub
Ideally, it would save as the applicant's name plus the current date... "John Smith 1-20-2015.doc, and to a specific folder on the desktop. But perhaps I'm dreaming.
Any help will be greatly appreciated. Thank you.