Reply
 
Thread Tools Display Modes
  #1   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

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.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Issues w/ Word MVP Macro to Mailmerge w/ Attachment

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.

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

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.


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Issues w/ Word MVP Macro to Mailmerge w/ Attachment

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.

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


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
Mailmerge Switch issues Sondra Mailmerge 6 February 18th 09 07:22 AM
Email word doc as attachment using a macro? lizb789 Microsoft Word Help 2 March 19th 08 08:56 PM
[Word 2003] macro issues imsite Microsoft Word Help 3 April 24th 07 09:48 AM
MailMerge Issues - doc 'forgets' source data, other issues Robert_L_Ross Mailmerge 2 February 22nd 07 10:38 AM
A Macro to E-mail Attachment from Word Jane Microsoft Word Help 0 September 12th 06 07:18 AM


All times are GMT +1. The time now is 09:37 AM.

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"