A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Issues w/ Word MVP Macro to Mailmerge w/ Attachment



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2009, 05:29 PM posted to microsoft.public.word.mailmerge.fields
The Mysterious J
external usenet poster
 
Posts: 15
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  
Old August 4th, 2009, 07:35 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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  
Old August 4th, 2009, 08:10 PM posted to microsoft.public.word.mailmerge.fields
The Mysterious J
external usenet poster
 
Posts: 15
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  
Old August 4th, 2009, 08:37 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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  
Old August 5th, 2009, 06:45 PM posted to microsoft.public.word.mailmerge.fields
The Mysterious J
external usenet poster
 
Posts: 15
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.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.