Compile Error: User-defined type not defined

Compile Error: User-defined type not defined

Post by UGF1bCB » Sat, 22 Jul 2006 13:51:01


When I try to follow the instructions for enabling email merging with an
attachment, I get "Compile Error: User-defined type not defined" after trying
to run the macro. Can anyone help? I am using Outlook 2003, Word 2003 (Office
2003) on a WinXP machine.

Here's what I did, per the instructions at
http://www.yqcomputer.com/

- I downloaded and executed the Express ClickYes utility for Outlook.
- I open both Outlook and Word 2003
- In Word, I created a Directory file per the instructions, saved and closed
it.
- In Word, I created and saved the macro from the above website and called
it "Mail_Merge_With_Attachment". I saved and closed out of Visual Basic (or
whatever window the Create Macro feature in Word opens.
- I then created a mail merge document, selected the data to merge (an Excel
file with company names, first names, etc).
- I completed the merge, going through the last step and actually merging
(that is, I select the "Merge - Electronic Mail" option.
- I try to run the macro while in Word and get the Compile error noted above.

Any help is appreciated! - Paul M.
 
 
 

Compile Error: User-defined type not defined

Post by Peter Jami » Sat, 22 Jul 2006 18:22:51

When you have the Visual Basic editor open, click Tools|References, locate
Microsoft Outlook nn.0 Object Library (e.g. Microsoft Outlook 11.0 Object
Library) and check it. Then save everything and try again.

Peter Jamieson

 
 
 

Compile Error: User-defined type not defined

Post by R2Fpb » Tue, 01 Aug 2006 19:08:02

Hi
Apologies for barging in. I have the same problem and have followed your
advice, but still get the same error message. Can anyone help?
--
GVP
 
 
 

Compile Error: User-defined type not defined

Post by Doug Robbi » Tue, 01 Aug 2006 20:03:36

If it is the "Compile Error: User-defined type not defined" error message
that you are getting, all that I can suggest is that you go back and make
sure that the necessary reference to the Microsoft Outlook nn.0 Object
Library had been made.

--
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
 
 
 

Compile Error: User-defined type not defined

Post by Peter Jami » Tue, 01 Aug 2006 22:44:07

Make sure that you are making the reference within the correct Word
project - e.g. make sure the macro is open and you have clicked somewhere in
its text before making the reference. (There might be more to it than that,
but that's where I would start).

Peter Jamieson