View Single Post
 
Old 09-01-2021, 03:01 PM
Lord Jim Lord Jim is offline Windows 7 64bit Office 97-2003
Novice
 
Join Date: Aug 2021
Posts: 3
Lord Jim is on a distinguished road
Default

Thanks Graham: I somehow managed to created a macro (maybe I'm not as dummy as I though)
Dim wbname As String
Dim pathONLY, filePATH, fileONLY As String
Dim datefrom As String
Dim dateto As String

' Selection.Find.ClearFormatting
With Selection.Find
.Text = "????.??.??"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Copy
datefrom = Selection.Text
datefrom = Right(datefrom, 8)
Selection.Find.Execute
Selection.Copy
dateto = Selection.Text
dateto = Right(dateto, 8)
wbname = datefrom & "-" & dateto
filePATH = ActiveDocument.FullName
fileONLY = ActiveDocument.Name
pathONLY = Left(filePATH, Len(filePATH) - Len(fileONLY))

ChangeFileOpenDirectory pathONLY
ActiveDocument.SaveAs FileName:=pathONLY & wbname & ".doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False

thanks again for quick answear
Reply With Quote