Code:
Sub Image_Folder()
'
'
'
'
ImageFolder = _
ActiveDocument.MailMerge.DataSource.DataFields("ImageFolder").Value
FL = Left(ImageFolder, 1)
FName = _
ActiveDocument.MailMerge.DataSource.DataFields("FName").Value
LName = _
ActiveDocument.MailMerge.DataSource.DataFields("LName").Value
File = LName & ", " & FName
NewPath = "Y:\OpenDentImages\" & FL & "\" & ImageFolder & "\"
Dim n As Integer
Dim FilePath As String
n = 0
Do
FilePath = "Y:\OpenDentImages\" & FL & "\" & ImageFolder & "\" & File & IIf(n = 0, "", n) & ".doc"
n = n + 1
Loop Until Dir(FilePath) = ""
ActiveDocument.SaveAs2 FilePath, FileFormat:=wdFormatPDF
ActiveDocument.SaveAs2 FilePath, FileFormat:=wdFormatDocumentDefault
End Sub
this is my code so far.
But it only seems to work on the actual template, but not after the data has been merged. Is it possible to maybe reference the template for the data instead of the ActiveDocument?
Thank you