Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mapi
Message
 
 
To
06/01/1999 15:31:17
Gordon Evans
Megabyte Computer Services Ltd
Sheffield, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Re: Mapi
Miscellaneous
Thread ID:
00172941
Message ID:
00173311
Views:
33
Gordon,

>I'm interested and puzzled that you mention the GetAttachment()!
>I was going to ask what code you had created for it! I thought it was a custom method you had added to your own mapi control.
>I have not seen a GetAttachment() or a GetMessage() both of which I thought were custom methods.


Ooops, those are custom methods of my MAPI container class:
* GetMessage()
if ( this.oleMAPISession.SessionID = 0 )
   return
endif

with this.oleMAPIMessages

   this.MsgSubject = ""
   this.MsgNoteText = ""
   this.mnAttachmentCount = 0
   this.mnAttachmentIndex = 0

   if ( this.mnMsgIndex < this.mnMsgCount )
      .MsgIndex = this.mnMsgIndex
      this.MsgSubject = .MsgSubject
      this.MsgNoteText = .MsgNoteText
      this.mnAttachmentCount = .AttachmentCount
   endif
endwith

return this.MsgSubject

* GetAttachment()
if ( this.oleMAPISession.SessionID = 0 )
   return
endif

with this.oleMAPIMessages
   this.mcAttachmentName = ""
   this.mcAttachmentPathName = ""
   this.mnAttachmentType = 0
   if ( this.mnAttachmentIndex < this.mnAttachmentCount - 1 )
      .AttachmentIndex = this.mnAttachmentIndex
      this.mcAttachmentName = .AttachmentName
      this.mcAttachmentPathName = .AttachmentPathName
      this.mnAttachmentType = .AttachmentType
   endif
endwith

return this.mcAttachmentName

*GetNextMessage()
if ( this.oleMAPISession.SessionID = 0 )
   return
endif

local lcRetVal

if ( this.mnMsgIndex < this.mnMsgCount )
   this.mnMsgIndex = this.mnMsgIndex + 1
   lcRetVal = this.GetMessage()
else
   lcRetVal = ""
endif

return lcRetVal

*GetNextAttachment()
if ( this.oleMAPISession.SessionID = 0 )
   return
endif

local lcRetVal

if ( this.mnAttachmentIndex < this.mnAttachmentCount - 2 )
   this.mnAttachmentIndex = this.mnAttachmentIndex + 1
   lcRetVal = this.GetAttachment()
else
   lcRetVal = ""
endif

return lcRetVal
>So far I can get the attached files and copy them to my down load dir.
>To do this I have to cheat by sending the file names in the subject and substitute these correct ones for the alias names in the temp dir.

In the system where I use this, I attach all the files to a single message and embed the filenames in the message, although I don't need to get them from the message itself.

>So my main problem is the alias name stuff mai,mai0,mai1.......
>
>I note your comment that:
>>You must make sure you are using at least the first SP1 version of IE4 if OE is your Simple MAPI client otherwise there's some significant bugs trying to get the attachments.
>Which is the more buggy the IE4 or OE?
>
>My IE4 says its sp1 and Outlook Express (I'll check the version)
>What SP is the current IE4 one?


My OE reports version 4.72.3110.5 The original OE4 gave me fits with reading the attachments and I had just about kludged up a workaround which involved adir() on the temp folder before and after getting the message from the buffer to handle them when the SP came out and fixed the problem.

The IE4 I'm running now is what VisualStudio98 installed. You should be able to go to the IE page and get the latest stuff.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform