Skip to content

Instantly share code, notes, and snippets.

@falu
Created April 15, 2018 13:06
Show Gist options
  • Save falu/68c19104560e87ed7ed13c57abcf871b to your computer and use it in GitHub Desktop.
Save falu/68c19104560e87ed7ed13c57abcf871b to your computer and use it in GitHub Desktop.
Aktuális körlevél rekord mentése
Sub Egyesit()
'
' Egyesit Makró
'
'
Dim adatszolg As String
Dim adoc As String
adatszolg = ActiveDocument.MailMerge.DataSource.DataFields("Adatszolg").Value
adatszolg = Replace(adatszolg, "-", "_")
adatszolg = Replace(adatszolg, "/", "_")
adoc = ActiveDocument.Name
adoc = adatszolg + "_" + adoc
adoc = Replace(adoc, "docm", "docx")
Debug.Print adoc
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With
ActiveDocument.SaveAs2 adoc
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment