Looking for MAPI32.ocx (simonbennet)??

I found the code written by simonbennet for extracting e-mail attachments, but i can't find MAPI32.ocx on our PCs.  I have found a dll by the same name.  We run NT4 and 95 PCs on our network with Office 97 SR2 and Outlook 2000.  I've also searched the MS Knowledge Base as well as the MSDN.  Can anybody e-mail it to me or tell me where i can download from?  
PeterGBTAsked:
Who is Participating?
 
simonbennettCommented:
Locking to get some attention!

Please reject and review comments.

Cheers

Simon
0
 
simonbennettCommented:
Hi there,

Try

ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/APPS/IMAGINE_LE/MSMAPI32.OCX

 - if that fails let me know you email address and I can send them.

Don't forget to run a

regsvr32 msmapi2.ocx

first!.

HTH

Simon

0
 
PeterGBTAuthor Commented:
Thanks simonbennet, i got it.  I've tried running regsvr32 but keep getting a "load failed" response.

I put msmapi32.ocx in ProgFiles\CommonFiles\System\Mapi\1033\nt.  Is this the right place?  Should i be using any switches?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
simonbennettCommented:
Sorry mate - put it in \winnt\system32

HTH

Simon
0
 
simonbennettCommented:
..and then run

regsvr32 msmapi32.ocx

from Start -> Run or the command prompt

Simon
0
 
PeterGBTAuthor Commented:
Thanks that's done and OK.

I've set up a reference to MS MAPI Controls 5, and  registered MS MAPI Session Control and Messages Control.  I also have references to MS Outlook 8 object library amonst others.

Now, you're going to think i'm really thick, but now when i step through the code it tells me "Method or Data Member not found", highlighting ".MAPISession1".  To confirm this, when i type a new line "Me.", the auto complete box that comes up after the dot does not contain MAPI as an alternative.

What am i doing wrong????

0
 
PeterGBTAuthor Commented:
Thanks that's done and OK.

Rebooted, and I've set up a reference to MS MAPI Controls 5, and  registered MS MAPI Session Control and Messages Control.  I also have references to MS Outlook 8 object library amongst others.

Now, you're going to think i'm really thick, but now when i step through the code it tells me "Method or Data Member not found", highlighting ".MAPISession1".  To confirm this, when i type a new line "Me.", the auto complete box that comes up after the dot does not contain MAPI as an alternative.

What am i doing wrong????

0
 
PeterGBTAuthor Commented:
Actually, i am wondering whether i got it right here.

In the Activex registration window, should the MAPI Session Control and MAPI Messages Control both point to the same ocx file?
0
 
PeterGBTAuthor Commented:
AND, i've just seen this "MISSING:  Microsoft MAPI Controls 5" in the references window.
0
 
simonbennettCommented:
You need to do the following..

1) Go to activex controls menu
2) Select msmapi32.ocx
3) Insert both the mapisession and the mapimessage controls onto the form that holds the code, calling them mapimessage1 and mapisession1.

HTH

Simon
0
 
PeterGBTAuthor Commented:
OK Got that.  Now, when i select either control type from the Activex menu and create a control on my form, i get a "You don't have the licence required to use this Activex control" message.

I'm really sorry about this, but can i ask what i should do?

Looks as though i might owe you a beer or two next time i'm in London............................
0
 
simonbennettCommented:
Hmm. No worries, sorry about this - if you email me you email address (to simonpbennett@hotmail.com) then tonight (sorry, its the international day of the conference call here today) I can send you all you should need. I think you may need the .oca and the .dep file.

Good Luck

Simon
0
 
simonbennettCommented:
Any luck with the files? I can't check my Hotmail at work!

Cheers

Simon
0
 
PeterGBTAuthor Commented:
Hi Simon

Loads of progress thanks!  I haven't/didn't receive any e-mail from you, but i guessed you were busy and feel bad enough already with the effort you've gone to, so last night i tried installing my MS VB5 CD-ROM, and guess what!  I now have your code working!

However, a minor bug or too i'm trying to get to grips with.  Firstly, the code will only copy one attachment from each e-mail.  A second or third attachment doesn't get copied.  Secondly, the attachment is saved with the filename in the old DOS format, i.e. 8 characters.  I am presuming that might be because we are running Netware servers and if i remember correctly, Netware doesn't support long file names.  The multi attachment problem is secondary, but the filename problem is really important since i import data from different regions of Cellnet, and they send me Excel spreadsheets with the naming format of xxxxxxxReport (Region).  Without the long filename support, i can't tell Access how to recognise which region has sent me a spreadsheet to import.  Or can i?.......
0
 
simonbennettCommented:
Hello Mate,

1)I'm glad the VB install worked - I did send 3 files to your BT address via Hotmail at about 10 last night, but I think we can assume that its bouncing around the ether causing havoc on some Guatemalan server or something/

2)I can't actually remember the code you are looking at, but does it have a loop like:

For intLoopCount = 1 To MAPIMessages1.AttachmentCount

   FileCopy Me.MAPIMessages1.AttachmentPathName, "c:\" & Me.MAPIMessages1.AttachmentName
               
   DoEvents

Next

in it? I use this now to transfer emails from client with attachements and it will work on up to 256 (which is the max attachments). If you have problems (and I know this sounds silly) post your code up for 'analysis'!

3)As for the file names you are right - it's a netware thing. However, i think you can parse the

Me.MAPIMessages1.AttachmentName

which, I believe, holds the name of the attachment *displayed* in the mail s opposed to the path. When you save the files however you are going to have to live with the restrictions.

Let me know if you need any more help

Cheers

Simon
0
 
simonbennettCommented:
Ok - I checked my mail yesterday and got a failure notice from your address - sorry 'bout that...

Simon
0
 
PeterGBTAuthor Commented:
Hi Simon

Apologies for lack of contact, been away on a course.

Got the process working now, and only with your help.  Thank you.

One more question.  I have used your code to copy attached spreadsheets to a directory for importing into my database using DoCmd.Transferspreadsheet.  Before, when i manually saved attachments, everything worked fine, but if i use the MAPI automation code, DoCmd.Transferspreadsheet returns an error message telling me the file was not in the expected format.  It is saved as an .xls, and in Excel, opens and displays normally.  Any ideas?
0
 
PeterGBTAuthor Commented:
Hi Simon

Apologies for lack of contact, been away on a course.

Got the process working now, and only with your help.  Thank you.

One more question.  I have used your code to copy attached spreadsheets to a directory for importing into my database using DoCmd.Transferspreadsheet.  Before, when i manually saved attachments, everything worked fine, but if i use the MAPI automation code, DoCmd.Transferspreadsheet returns an error message telling me the file was not in the expected format.  It is saved as an .xls, and in Excel, opens and displays normally.  Any ideas?
0
 
PeterGBTAuthor Commented:
Ooops, done it again.............
0
 
simonbennettCommented:
Hiya,

Are you running the

FileCopy Me.MAPIMessages1.AttachmentPathName, "c:\" & Me.MAPIMessages1.AttachmentName

First? IF so it could be a file handle issue. You will need to do the copy first and then in another procedure transferspreadsheet in.

Let me know etc...

Simon
0
 
PeterGBTAuthor Commented:
OK, here are the two bits of code:

If Me.MAPIMessages1.MsgSubject Like "*North*" Then
    FileCopy Me.MAPIMessages1.AttachmentPathName, "G:\Shared\TSCR\TSCR Cellbuild\Trafficlight Report\Received\Trafficlight Report (North).xls"

And then, in a different procedure, i am using:

DoCmd.TransferSpreadsheet acImport, 8, "ImportNorth", "G:\Shared\Tscr\Tscr Cellbuild\Trafficlight Report\Received\Trafficlight Report (North).xls", True

If i manually save the attachment to the specified location, no problems.  The error only occurs when using the automated attachment code.
0
 
andrejtCommented:
Dear PeterGBT!

May I get your code (based on simonbennett's tutorial) since the MAPI ocx solution seems to solve my problem as well.
Thanks a lot!

AndrejT
0
 
PeterGBTAuthor Commented:
Hi AndrejT

Sorry i haven't replied earlier.

Please e-mail me at peter.gidden@bt.com with your exact requirements and i will send you copies of my code.  Are you working in Access97?

Regards

Peter Gidden
0
 
BalduinoCommented:
I'm trying to send a file usin a MAPI Message Control in a Access form.
 
Can some one help me?
 
All the steps download the msmapi32.ocx, run "regsvr32 msmapi32.ocx" in c:\windows\system are ok! But when when I select either control type from the Activex menu and create a control on my form, I get a "You don't have the licence required to use this Activex control" message.
 
I think that I need the .oca and the .dep file. like Simon anser PeterGBT. Can you send it me? I don't have the VB5 or 6 CD-Rom.

Thanks a lot!

Regards,
 
Marcos Balduino.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.