Created
April 15, 2018 13:06
-
-
Save falu/68c19104560e87ed7ed13c57abcf871b to your computer and use it in GitHub Desktop.
Aktuális körlevél rekord mentése
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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