E-mail with attachment problem

J

Jomark

i have downloaded Doug Robbins article and created a macro by pasting into
the Macro.

I created the directory and saved it

I created a new e-mail merge document and created the mail merge messages.

on running the macro I receive a compile error 'User-defined type not
defined' for the following "Dim oOutlookApp As Outlook.Application"

When saving the directory what name should it be given? is it maillist?
It is not that clear to me from the article
 
D

Doug Robbins - Word MVP

You have not followed the instructions in the Preparation section of the
article. In the Visual Basic Editor, by selecting References from the Tools
menu, you must set a reference to the Microsoft Outlook ##.0 Object Library,
## will be a number that depends on the version of Office that you are
using - its 12 in Office 2007; 11 in Office 2003, etc.

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

Are you sure that it wasn't the Cancel button that you clicked by mistake?

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

Jomark

Definitely not pressing the wrong button!

I finally got it to work.

I always thought that if you selected the reference that it would be
permanently selected but it seems to be only document specific. Is that
correct?

the macrocode has to be entered afresh each time as otherwise it kicks out
the reference.

also when the dialog box to enter the subject line is closed using the form
close buttons in order to exit without entering anything the screen starts to
flash and eventually the only way to stop it is through task manager.

Whilst the procedure works, the instructions are not very clear for mere
mortals and the explanation given in another post by Alexandrios is more
specific.
 
D

Doug Robbins - Word MVP

The macro should not be in the document, rather it should be in a global
template - that is either the normal.dot template or a template that is
saved in the Word Startup folder so that it is available to all documents.

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

Jomark

Ah, so if I add it to the global template and reference the object library
then it will be for every document based on that template. Is that correct?
 
D

Doug Robbins - Word MVP

If it's in a Global template, it will be available for any document created
from any template, not just the normal template if it is in the normal
template that you have the macro. The statement holds true for any template
that you save in the Word Startup folder, but in that case, you are never
creating a document from the template that is saved in that location as you
might be from the normal template.

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

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