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  

email merge w/attachments:compile error-user defined type not defi



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2009, 09:47 AM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not defi

I've tried to follow all the steps and feel like I'm almost there, but when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel 12.0
Object Library checked. Not sure what to do now. Help!
  #2  
Old May 21st, 2009, 10:20 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default email merge w/attachments:compile error-user defined type notdefi

I'm sure Doug will have the answer but meanwhile, since you are
referencing Excel as well, you may need to qualify any of the
declarations that reference a type that can be either in the Excel or
Word object models. e.g.

change

Dim Datarange As Range

to

Dim Datarange As Word.Range

(because there is a different Excel.Range)

Maybe also change

Dim Source As Document, Maillist As Document, TempDoc As Document

to

Dim Source As Word.Document, Maillist As Word.Document, TempDoc As
Word.Document

although I do not think there is any clash in this case.

Peter Jamieson

http://tips.pjmsn.me.uk

patricia wrote:
I've tried to follow all the steps and feel like I'm almost there, but when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel 12.0
Object Library checked. Not sure what to do now. Help!

  #3  
Old May 21st, 2009, 11:25 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default email merge w/attachments:compile error-user defined type not defi

What line of code is highlighted when you receive that error message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there, but
when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel
12.0
Object Library checked. Not sure what to do now. Help!


  #4  
Old May 21st, 2009, 08:35 PM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not

oOutlookApp As Outlook.Application and when I hit enter, the Sub line is
highlighted.

"Doug Robbins - Word MVP" wrote:

What line of code is highlighted when you receive that error message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there, but
when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel
12.0
Object Library checked. Not sure what to do now. Help!



  #5  
Old May 21st, 2009, 08:48 PM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not

I tried adding the Word. in those 4 instances, but I'm still getting the
compile error.

"Peter Jamieson" wrote:

I'm sure Doug will have the answer but meanwhile, since you are
referencing Excel as well, you may need to qualify any of the
declarations that reference a type that can be either in the Excel or
Word object models. e.g.

change

Dim Datarange As Range

to

Dim Datarange As Word.Range

(because there is a different Excel.Range)

Maybe also change

Dim Source As Document, Maillist As Document, TempDoc As Document

to

Dim Source As Word.Document, Maillist As Word.Document, TempDoc As
Word.Document

although I do not think there is any clash in this case.

Peter Jamieson

http://tips.pjmsn.me.uk

patricia wrote:
I've tried to follow all the steps and feel like I'm almost there, but when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel 12.0
Object Library checked. Not sure what to do now. Help!


  #6  
Old May 21st, 2009, 08:49 PM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not

I tried adding the Word. to those 4 instances, but I'm still getting the
compile error.


"Peter Jamieson" wrote:

I'm sure Doug will have the answer but meanwhile, since you are
referencing Excel as well, you may need to qualify any of the
declarations that reference a type that can be either in the Excel or
Word object models. e.g.

change

Dim Datarange As Range

to

Dim Datarange As Word.Range

(because there is a different Excel.Range)

Maybe also change

Dim Source As Document, Maillist As Document, TempDoc As Document

to

Dim Source As Word.Document, Maillist As Word.Document, TempDoc As
Word.Document

although I do not think there is any clash in this case.

Peter Jamieson

http://tips.pjmsn.me.uk

patricia wrote:
I've tried to follow all the steps and feel like I'm almost there, but when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel 12.0
Object Library checked. Not sure what to do now. Help!


  #7  
Old May 21st, 2009, 10:06 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default email merge w/attachments:compile error-user defined type not

That would indicate that the reference to the Outlook Object Library has not
been (properly) set or retained.

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
oOutlookApp As Outlook.Application and when I hit enter, the Sub line is
highlighted.

"Doug Robbins - Word MVP" wrote:

What line of code is highlighted when you receive that error message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there, but
when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel
12.0
Object Library checked. Not sure what to do now. Help!




  #8  
Old May 22nd, 2009, 09:04 PM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not

I do that by going into the Word document, selecting Developer, then Visual
BasicToolsReferences, right? Then check the box next to Microsoft Outlook
Object Library 12.0. It was checked, but now it's not, so you're right, it's
not being retained. Why do you think that would be?

(By the way, I noticed in other postings that Tammy had the same error
message; she was able to click the box and got it working. Not sure why my
fix hasn't been so easy, but I'm trying).

Thank you so much for your help.

Patricia

"Doug Robbins - Word MVP" wrote:

That would indicate that the reference to the Outlook Object Library has not
been (properly) set or retained.

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
oOutlookApp As Outlook.Application and when I hit enter, the Sub line is
highlighted.

"Doug Robbins - Word MVP" wrote:

What line of code is highlighted when you receive that error message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there, but
when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel
12.0
Object Library checked. Not sure what to do now. Help!




  #9  
Old May 26th, 2009, 07:01 PM posted to microsoft.public.word.mailmerge.fields
Patricia
external usenet poster
 
Posts: 147
Default email merge w/attachments:compile error-user defined type not

I got it - yeah! And you're right, Doug, just follow the steps. I ended up
starting over and doing it one by one. I believe my problem was that I was
not merging into a new document.....Thanks so much for your help.

"patricia" wrote:

I do that by going into the Word document, selecting Developer, then Visual
BasicToolsReferences, right? Then check the box next to Microsoft Outlook
Object Library 12.0. It was checked, but now it's not, so you're right, it's
not being retained. Why do you think that would be?

(By the way, I noticed in other postings that Tammy had the same error
message; she was able to click the box and got it working. Not sure why my
fix hasn't been so easy, but I'm trying).

Thank you so much for your help.

Patricia

"Doug Robbins - Word MVP" wrote:

That would indicate that the reference to the Outlook Object Library has not
been (properly) set or retained.

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
oOutlookApp As Outlook.Application and when I hit enter, the Sub line is
highlighted.

"Doug Robbins - Word MVP" wrote:

What line of code is highlighted when you receive that error message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there, but
when I
run the macro I get the above error message. I've checked to see that
VBToolsReferences has Microsoft Word 12.0 Object Library, Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft Excel
12.0
Object Library checked. Not sure what to do now. Help!




  #10  
Old May 27th, 2009, 05:28 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default email merge w/attachments:compile error-user defined type not

Glad you got it working.

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I got it - yeah! And you're right, Doug, just follow the steps. I ended
up
starting over and doing it one by one. I believe my problem was that I
was
not merging into a new document.....Thanks so much for your help.

"patricia" wrote:

I do that by going into the Word document, selecting Developer, then
Visual
BasicToolsReferences, right? Then check the box next to Microsoft
Outlook
Object Library 12.0. It was checked, but now it's not, so you're right,
it's
not being retained. Why do you think that would be?

(By the way, I noticed in other postings that Tammy had the same error
message; she was able to click the box and got it working. Not sure why
my
fix hasn't been so easy, but I'm trying).

Thank you so much for your help.

Patricia

"Doug Robbins - Word MVP" wrote:

That would indicate that the reference to the Outlook Object Library
has not
been (properly) set or retained.

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
oOutlookApp As Outlook.Application and when I hit enter, the Sub line
is
highlighted.

"Doug Robbins - Word MVP" wrote:

What line of code is highlighted when you receive that error
message?

--
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, originally posted via msnews.microsoft.com
"patricia" wrote in message
...
I've tried to follow all the steps and feel like I'm almost there,
but
when I
run the macro I get the above error message. I've checked to see
that
VBToolsReferences has Microsoft Word 12.0 Object Library,
Microsoft
Office
12.9 Office Library, Microsoft Outlook 12.0 Library and Microsoft
Excel
12.0
Object Library checked. Not sure what to do now. Help!





 




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 12:33 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.