Lüko Willms was telling us:
Lüko Willms nous racontait que :
Is there a way to the MailMerge.DataSource as a Word-Document-Object
(when it is a Word-Document, of course), without EditDataSource and
catching the then "ActiveDocument"?
Try this:
Dim docMain As Document
Dim docSource As Document
Set docMain = ActiveDocument
Set docSource = Documents.Open(docMain.MailMerge.DataSource.Name)
Of course, you may need to add error checking in case the current document
is not attached to a merge source:
Dim docMain As Document
Dim docSource As Document
Set docMain = ActiveDocument
If docMain.MailMerge.DataSource.Name <> "" Then
Set docSource = Documents.Open(docMain.MailMerge.DataSource.Name)
Else
MsgBox "The current document is not a mailmerge type of document.", _
vbInformation, "Error"
End If
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org