View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
The Mysterious J The Mysterious J is offline
external usenet poster
 
Posts: 5
Default Issues w/ Word MVP Macro to Mailmerge w/ Attachment

By George, I think I've got it.

It didn't work at first, but then I checked my directory file and found I
had put bad file addresses in it. When I corrected that error, it went off
without a hitch. Thank you, MVP, and thank you, Peter Jamieson!

"Peter Jamieson" wrote:

When you open that dialog, the /checked/ libraries are shown at the top.
They are the ones that already have a reference to them. So you do not
need to /uncheck/ an existing one. You need to look down the list of the
/unchecked/ items, locate the Microsoft Outlook 11.0 Object Library (or
whatever it is actually called), and check /that/ one (and recheck the
one you unchecked, of course :-) )

Peter Jamieson

http://tips.pjmsn.me.uk

The Mysterious J wrote:
In the VBA editor, the only checked items we
Visual Basic for Applications
Microsoft Word 11.0 Object Library
Microsoft Office 12.0 Object Library
OLE Automation

I tried disabling Microsoft Office 12.0 Object library, but still got the
same error when running the macro. The Microsoft Word 11.0 Object Library
cannot be disabled because Word is running at the time (error = "Can't remove
control or reference, in use").

Any other suggestions?

"Peter Jamieson" wrote:

I don't know where to find that.

In the VBA Editor, with the module open that uses the
Outlook.Application stuff, look in Tools-References. Make sure you
/check/ the library - just selecting it is easily done but it isn't
enough (which is probably why Doug suggested you re-check).

Peter Jamieson

http://tips.pjmsn.me.uk

The Mysterious J wrote:
I've tried the instructions from Word MVP. I believe I have followed
everything correctly. The pasted macro created the following compile error:
"Compile error: User-defined type not defined.": with the following lines:

Dim oOutlookApp As Outlook.Application
Dim oItem As Outook.MailItem

I read the post where Doug Robbins indicates:
Recheck again whether the Outlook Object Library still has a checkmark
against it. Almost certainly, that is the cause of the problem.

I don't know where to find that.

Also, I tried just removing those two lines of code, and the macro ran
perfectly except it didn't attach anything to the e-mails.

Thanks in advance for your assistance.