Hi,
I tried to generate document from employee file, but it is not working correctly
Here are basic data:
- I generated mail merge template
- I created my own Word Template with macro from Help documentation ( see attachment PLATOVY_VYMER.zip)
Public Sub DoMailMerge(sFile As String)
ActiveDocument.MailMerge.OpenDataSource Name:=sFile, _ ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _ Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1 _ :="" With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .MailAsAttachment = False .MailAddressFieldName = "" .MailSubject = "" .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=False End With End Sub
- I created my own word template definition. I specified full path to word template on my local PC.
- In Employee file I click on Generate document, select my template and click on Generate.
-
Word file is open, I click Yes on message
but no data are fetched from application.
Are there some additional settings or is it a bug?
Thank for help
Romana