Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAPIMessage Problems Attaching
Message
 
 
To
24/05/1999 17:22:42
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00222242
Message ID:
00222298
Views:
21
Sara,

The Index properties are 0 based and the AttachmentName can only be filename with no path. Here's a chunk of code from my email class:
lparameter pcFileName

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

local i

this.txtStatus.Value = "Attaching:" + pcFileName

with this.oleMAPIMessages
   this.mnAttachmentCount = this.mnAttachmentCount + 1
   dimension this.maAttachments[this.mnAttachmentCount]
   .AttachmentIndex = this.mnAttachmentCount - 1
   .AttachmentPathName = pcFileName
   i = rat( "\", pcFileName )
   this.maAttachments[this.mnAttachmentCount] = substr( pcFileName, i+1 )
   .AttachmentName = this.maAttachments[this.mnAttachmentCount]
   .AttachmentType = 0
endwith
>I am trying to attach a file to email, but I keep getting that error that the Attachment is not found even though it really is there. Here is my code:
>
>WITH THISFORM
> .oleSession.Signon
> IF .oleSession.SessionID > 0
> .oleMessage.SessionID = .oleSession.SessionID
> ELSE
> RETURN .F.
> ENDIF
>
> .oleMessage.Compose
> .oleMessage.MsgSubject="Witness Needed"
> .oleMessage.AttachmentIndex=.oleMessage.AttachmentCount+1
> .oleMessage.AttachmentPathName="c:\form.pdf"
> .oleMessage.AttachmentName=""
> .oleMessage.RecipIndex = 0
> .oleMessage.RecipDisplayName=RecipName
> .oleMessage.ResolveName
> .oleMessage.Send(0)
>
>ENDWITH
>
>Thanks for the help-Sara
df (was a 10 time MVP)

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

Click here to load this message in the networking platform