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
|