Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Emily Emily is offline
external usenet poster
 
Posts: 32
Default Problems with Mail merge with attachment

Hi,

I am trying to send individual emails with individual attachments. I have
followed the steps outlined in the article "Mail Merge to E-mail with
Attachments" and am having a little trouble.

I have created the directory, written the email I want to send, connected to
data source (same one that I used for the directory) and copied the Macro.
However, I when I run the macro I get the message "Compile error: statement
invalid outside Type block" and the line of code that reads " Maillist As
Document, TempDoc As Document" is highlighted. Should I have the directory
open when I start the merge? Do I run the macro or just try to send the
email merge? I am very confused and have not worked much with Macros or VBA
Editor. Also, it says in the article that when I run the Macro I will be
asked to open the directory but that has not happened. I'm sure I am doing
something wrong, but I don't know what.

Any assistance you can offer would be greatly appreciated.

--
Thanks,

Emily
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Problems with Mail merge with attachment

It sounds to me as if you might have copied the VBA macro so that you ended
up with

Sub emailmergewithattachments()
Dim Source As Document
Maillist As Document, TempDoc As Document

(etc.)

when you should have

Sub emailmergewithattachments()
Dim Source As Document, Maillist As Document, TempDoc As Document

(etc.)

Sometimes when you copy VBA code from an example, the lines can be split and
if you try to "fix" them and get it wrong you may end up with various sorts
of error.

In this case for example you would probably have had to remove a comma at
the end of

Dim Source As Document

to get this error.

Although I copied this code without problems, I suggest that once you have
copied it, you check what you have in VBA visually against the code in
Doug's article.

You'll have to fix this problem before the macro will run and prompt you for
a file name.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Emily" wrote in message
...
Hi,

I am trying to send individual emails with individual attachments. I have
followed the steps outlined in the article "Mail Merge to E-mail with
Attachments" and am having a little trouble.

I have created the directory, written the email I want to send, connected
to
data source (same one that I used for the directory) and copied the Macro.
However, I when I run the macro I get the message "Compile error:
statement
invalid outside Type block" and the line of code that reads " Maillist As
Document, TempDoc As Document" is highlighted. Should I have the
directory
open when I start the merge? Do I run the macro or just try to send the
email merge? I am very confused and have not worked much with Macros or
VBA
Editor. Also, it says in the article that when I run the Macro I will be
asked to open the directory but that has not happened. I'm sure I am
doing
something wrong, but I don't know what.

Any assistance you can offer would be greatly appreciated.

--
Thanks,

Emily


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Mail Merge w/ Attachment Problems Melissa Mailmerge 8 November 2nd 08 07:07 AM
Mail Merge mass mailing with e-mail sentence and attachment BL Mailmerge 1 August 23rd 08 06:29 AM
Word Mail Merge to E-mail message with attachment? Frank D. Nicodem, Jr. Mailmerge 4 April 25th 07 07:01 PM
attachment and mail merge guy New Users 2 May 30th 06 03:05 PM
mail merge email attachment problems Jimmy Mailmerge 1 April 21st 05 08:30 AM


All times are GMT +1. The time now is 12:44 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"