B
Bev
Can someone please help, I'm trying to automate a merge process with a User
Form where the user supplies the drivepath of the data source.
Since the data source is a variable my code looks like:
Dim SecDataSource as Object
Set SecDataSource = UserForm1.SecDrivepath.Text
ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
ActiveDocument.MailMerge.OpenDataSource Name:="SecDataSource", .......
But VB tells me there's a compile error "Type Mismatch" where ".Text" is
highlighted on the code line where the Set command is given. Have I declared
the variable wrongly?
Form where the user supplies the drivepath of the data source.
Since the data source is a variable my code looks like:
Dim SecDataSource as Object
Set SecDataSource = UserForm1.SecDrivepath.Text
ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
ActiveDocument.MailMerge.OpenDataSource Name:="SecDataSource", .......
But VB tells me there's a compile error "Type Mismatch" where ".Text" is
highlighted on the code line where the Set command is given. Have I declared
the variable wrongly?