Email Merge with Attachment

L

LyndieBee

I'm using the directions from Doug Robbins "Mail Merge to E-mail with
Attachments" article. I've done the prep, created the directory merge with
email addresses and document names. I've created the letter merge to a new
document and run the macro. Every thing seems to work correctly at the
start--I get the "Enter the subject..." and the rest of the preliminary
stuff. Then it starts to do it's work and I answer Yes to "A program is
trying to automatically send e-mail..." for the 3 addresses in my sample
list. But at this point it seems to hang and I continue getting this
Information box for Document 4, Document 5, Document 6, etc. until I
Ctrl-Break to stop the process. When I look at the macro contents it points
to this section:
End With
Set oItem = Nothing
ActiveDocument.Close wdDoNotSaveChanges
Counter = Counter + 1
Wend
Any ideas about what my problem is and how I can correct it? I'm so close
and yet so far away.
Thanks,
Lyndie
 
D

Doug Robbins - Word MVP

Have you activated the Express Click Yes utility?

What you see in the Visual Basic Editor after pressing Ctrl-Break, doesn't
really mean anything is wrong with that section of the code.

In the letter that you are trying to email with the attachments, how many
Sections are there?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
L

LyndieBee

For my test file, it is a one-liner attachment with only one section. Do I
need section break at the end of the text?
 
L

LyndieBee

In answer to your Express ClickYess utility, yes I have downloaded it and it
works fine. Thanks!
 
L

LyndieBee

I believe I misunderstood your question. There are 5 section. A Next Page
Section Break after each of the letters, and a Continuous Section Break at
the end of the document.
 
D

Doug Robbins - Word MVP

It was not the attachment about which I was asking the number of Sections.
It was the mail merge document that is going to be emailed and to which the
other document/file is going to be attached. That is the document that is
created by executing the merge to a new document and which is to be the
Active Document when the macro is run.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

It sounds like you did not use the same datasource to create that document
as you used to create the directory document in which then filenames of the
attachments appear, or at least did not merge the same number of records
each time.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Joris

Hi,
I tried to do the same (using the emailmergewithattachments macro) and
didn't get really far. Visual basic points to the 'Dim oOutlookApp As
Outlook.Application' line.

I merged a word table with an excel db. That word table contains in the
first column the emails, in the second the attachment name and location. I
tried with the first row as the headings or not.
I then merged my excel db with a word template letter. ANd upon running the
macro, it doesn't work, opening visual basic as previously said.

Any help much appreciated.

Thanks
 
G

Graham Mayor

Joris said:
Hi,
I tried to do the same (using the emailmergewithattachments macro) and
didn't get really far. Visual basic points to the 'Dim oOutlookApp As
Outlook.Application' line.
From the vba editor Tools > References - check the Microsoft Outlook option.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

Allan S. Warrior

I'm also having trouble with the same variable declaration. I do have the
Outlook Reference checked, but it still fails to recognize the type.

Outlook 2003, Word 2003, Windows XP.
 
D

Doug Robbins - Word MVP

The reference is to the "Microsoft Outlook 11.0 Object Library"?

Are you able to use Outlook to send a document by selecting Send from the
File menu in Word?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

Allan S. Warrior

Sorry, I was being an idiot. Or at least demonstrating very poor attention to
detail. I clicked the reference, but missed the checkbox. When I went back
in to check once again, I discovered my error. Once corrected it worked
great. I blame Friday-mind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top