Solved

Looking for MAPI32.ocx (simonbennet)??

Posted on 2000-02-14
24
925 Views
Last Modified: 2010-07-27
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?  
0
Comment
Question by:PeterGBT
  • 12
  • 10
  • +1
24 Comments
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
Sorry mate - put it in \winnt\system32

HTH

Simon
0
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
..and then run

regsvr32 msmapi32.ocx

from Start -> Run or the command prompt

Simon
0
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
AND, i've just seen this "MISSING:  Microsoft MAPI Controls 5" in the references window.
0
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
Any luck with the files? I can't check my Hotmail at work!

Cheers

Simon
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:PeterGBT
Comment Utility
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
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
Ok - I checked my mail yesterday and got a failure notice from your address - sorry 'bout that...

Simon
0
 
LVL 6

Accepted Solution

by:
simonbennett earned 50 total points
Comment Utility
Locking to get some attention!

Please reject and review comments.

Cheers

Simon
0
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
Ooops, done it again.............
0
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Expert Comment

by:andrejt
Comment Utility
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
 

Author Comment

by:PeterGBT
Comment Utility
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
 

Expert Comment

by:Balduino
Comment Utility
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now