Quote:
Originally Posted by Mahmed1
Are you saying have a default Mail merge document already set up with all the fields and records ?
|
Yes, I've said this
twice already.
Quote:
Ps what would the difference be in not having a template already set up?
|
It is not a
template, it is a
document. The difference in having it set up is that you don't then have to try to construct everything with code. The setup and maintenance are much easier for you that way.
Quote:
What would do these lines of code do?
.DataSource
.FirstRecord = wdDefaultFirstRecord
.Lastrecord = wdDefaultLastRecord
|
They tell the merge to use all the available records.
Quote:
And with the select statement, i know we are selecting everthing from excel sheet but where is the code for connecting to a provider.
|
That's what ".OpenDataSource Name:=strWorkbookName" does.
Quote:
Can this be easily amended so i can use a label or envelope?
|
Yes, by changing ".MainDocumentType = wdFormLetters".
Instead of asking questions all the time and adding in code that you don't understand, you should spend a little time: (a) learning how mailmerge works when it's not using vba; and (b) seeing what the VBA help tells you about each parameter. If you don't take the time for (a) you'll never master (b).