emailmergewithattachments on Outlook 2003 SP3

S

sgadams

Hi -

I have been using Doug Robbins excellent macro to mail merge
attachments. My previous setup was Outlook 2000 to create merge doc
in Word 2000 and the macro ran great.

I have a separate computer running Outlook 2003 SP3 with Word 2000.
Outlook 2003 will not create a mail merge doc without having Word
2003. So I just use the existing list in Word 2000 that has my files
and e-mail addresses. In that Word 2000 doc I have set the VB
Reference to Outlook 11.0 (for Outlook 2003). I also saved and exited
to be sure it pointed to Outlook 11.0. But the macro loops through
and does not create any e-mails or attachments. Stepping through it
is resolving the paths for the attachments, etc. The break seems to
be that it is not calling Outlook 2003. It does not trigger the
Outlook security either.

Any ideas?
Thanks!
S
 
D

Doug Robbins - Word MVP

I think that it is probably some sort of security issue, but try putting a

MsgBox Oitem.Subject

before the

Set oItem = Nothing

to see if the Outlook Mail Item is being created.

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

sgadams

Thanks -

I made the update as suggested and the msgbox does not show upon
runtime. When I step through, the msgbox value is object variable not
set.

So I guess the item is not being created?

S
 
D

Doug Robbins - Word MVP

Try running the following code

Dim oOutlookApp as Outlook.Application
Dim oItem as Outlook.MailItem
Set oOutlookApp = GetObject(, "Outlook.Application")
Set oItem = oOutlook.App.CreateItem(olMailItem)
With oItem
.Subject = "Test"
.Body = ActiveDocument.Content
.PrintOut
End With
Set oItem = Nothing
Set oOutlookApp = Nothing

It should cause a "document" to be printed on the default printer with the
subject line of "Test" and the body of the message being the text of the
document that was the active document when you run the macro.

This will test whether the mail item is being created.

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

sgadams

Thanks for helping me debug. I ran that code and get a "Run-time
error '429' ActiveX component can't create object."

Maybe it has something to do with the Outlook 2003 type library? I set
a reference to Microsoft Outlook 11.0 Object Library which points to
Program Files\Microsoft Outlook\OFFICE11\msoutl.olb. But since I am
running Word 2000 I wonder if it has a problem with that? Any way to
manually register the Outlook 2003 olb?

Thanks!
S
 
D

Doug Robbins - Word MVP

I think that you may be out of luck. I had not realised that you were still
using Word 2000.

See the article "Upgrading Outlook but not Office" at:

http://www.slipstick.com/outlook/ol2003/upgrade.htm

The owner of that site is the most knowledgable person around when it comes
to Outlook.


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

sgadams

Hi -

Thanks for you help! I was able to make it work by looking up the run
time error 429. It suggested re registering the Outlook 2003. Tried
that but /regserver does not work for 2003. So then I confimed the
clsid's in registry. Finally I ran a detect and repair in Outlook.
Still did not work. Finally I shut down zone alarm and anti-virus,
ran the macro and it worked. Then I restarted zone alarm and anti-
virus and still works. So I am able to automate Outlook 2003 from
Word 2000 (just cannot go the other way from Outlook 2003 to Word
2000).

Thanks again!
S
 

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