happyfeet09
New Member
- Joined
- Aug 10, 2012
- Messages
- 1
Hello,
I'm new to and not well-versed in VBA, but have been working my way towards an automatic mailmerge. The last step which I can't seem to figure out or find an answer for is to save the mail-merged files with part of the saved name being drawn from a specified cell in excel, basically the name of that person for whom the mail merge document was created.
I have done the following for the mail merging portion, and have it working (and I realize I probably have pretty clunky code - of course cleaning it up would be helpful, which, as time permits, I will attempt to do):
1. From excel a macro opens the word mailmerge after creating a cleaned-up excel sheet from which to work, and also creates folders with the individuals' names (where I want to save the mailmerge files).
2. In Word, the documents are created successfully (upon opening the document) and I can save them individually. However, I want that to be done automatically.
Basically, I need to know how (in Word) to define a variable as a certain cell in the excel sheet that is the data source for the mail merge, and then for each record after the first, to go down the same column (e.g. record 1 - the first mail merge document - takes from cell B2 and saves with the contents fo B2 in the file name, 2 from cell B3, 3 from cell B4, etc.).
All help is appreciated. Thanks!
I'm new to and not well-versed in VBA, but have been working my way towards an automatic mailmerge. The last step which I can't seem to figure out or find an answer for is to save the mail-merged files with part of the saved name being drawn from a specified cell in excel, basically the name of that person for whom the mail merge document was created.
I have done the following for the mail merging portion, and have it working (and I realize I probably have pretty clunky code - of course cleaning it up would be helpful, which, as time permits, I will attempt to do):
1. From excel a macro opens the word mailmerge after creating a cleaned-up excel sheet from which to work, and also creates folders with the individuals' names (where I want to save the mailmerge files).
2. In Word, the documents are created successfully (upon opening the document) and I can save them individually. However, I want that to be done automatically.
Basically, I need to know how (in Word) to define a variable as a certain cell in the excel sheet that is the data source for the mail merge, and then for each record after the first, to go down the same column (e.g. record 1 - the first mail merge document - takes from cell B2 and saves with the contents fo B2 in the file name, 2 from cell B3, 3 from cell B4, etc.).
All help is appreciated. Thanks!