Attach file from OUTLOOK 
Author Message
 Attach file from OUTLOOK

  Dear all
      I don't know what happen on my program. I would like to attach file from outlook.
I try to write a program for call outlook.

oSession = CREATEOBJECT("MSMapi.MapiSession")
oMessage = CREATEOBJECT("MSMapi.MapiMessages")

      oSession.LogonUI = .t.
      oSession.SignOn

      *-- The message control needs to reference the session control's ID.
      oMessage.SessionID = oSession.SessionID
      oMessage.MsgIndex = -1

      *-- Set up our message and send it.
      oMessage.Compose
      oMessage.msgsubject =  "Quotation No. : " + alltrim(thisformset.qutform.text1.value)

      *-- Create an array holding the attachment file names.
      DIMENSION lcAttachment(1)
      lcAttachment(1) = "c:\QU100203.pdf"  &&+ alltrim(thisformset.qutform.text1.value) + '.pdf'
      *-- Attach the files.
      FOR lnCount = 1 TO ALEN(lcAttachment)
        oMessage.AttachmentIndex = lnCount - 1
         oMessage.AttachmentPathName = lcAttachment(lnCount)

      ENDFOR

      *-- Send the message on its way.
        oMessage.send(1)

after that I got the error message :
OLE IDispatch exception code 0 from MAPIMessages: Unspecified Failure has occurred.

Anyone can help me to slove it.
Thanks you



Fri, 02 Sep 2005 19:46:50 GMT  
 Attach file from OUTLOOK
Hi JJ:

Instead of debugging your code, take a look at the second example in this
article.  I modified it to use my profile name and a file on my hard drive,
and it works just fine.

175052 HOWTO: Send a Message in Visual FoxPro Using Active Messaging
http://support.microsoft.com/?id=175052

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

Quote:
>  Dear all
>      I don't know what happen on my program. I would like to attach file
from outlook.
> I try to write a program for call outlook.
> oSession = CREATEOBJECT("MSMapi.MapiSession")
> oMessage = CREATEOBJECT("MSMapi.MapiMessages")
>      oSession.LogonUI = .t.

 >     oSession.SignOn
 >     *-- The message control needs to reference the session control's ID.
Quote:
>      oMessage.SessionID = oSession.SessionID
>      oMessage.MsgIndex = -1
>      *-- Set up our message and send it.

 >     oMessage.Compose
Quote:
>      oMessage.msgsubject =  "Quotation No. : " +

alltrim(thisformset.qutform.text1.value)
Quote:
>      *-- Create an array holding the attachment file names.
>      DIMENSION lcAttachment(1)
>      lcAttachment(1) = "c:\QU100203.pdf"  &&+

alltrim(thisformset.qutform.text1.value) + '.pdf'
Quote:
>      *-- Attach the files.
>      FOR lnCount = 1 TO ALEN(lcAttachment)
>        oMessage.AttachmentIndex = lnCount - 1

 >        oMessage.AttachmentPathName = lcAttachment(lnCount)
Quote:
>      ENDFOR
>      *-- Send the message on its way.

 >       oMessage.send(1)
Quote:
>after that I got the error message :
>OLE IDispatch exception code 0 from MAPIMessages: Unspecified Failure has
occurred.
>Anyone can help me to slove it.
>Thanks you



Fri, 02 Sep 2005 23:44:19 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Attach File on OUTLOOK 2002

2. Attach file to Outlook

3. Can I attach icon in Foxpro .exe file

4. Foxpro 2.5 Attaching files to records?

5. how to attach screen to renamed database file?

6. :Re: Foxpro 2.5 Attaching files to records?

7. vfp 6.0 Attach Icon-file to *.exe

8. Can I attach text file as table??

9. sample files attached

10. attaching icon to exe file

11. Attaching files to a Table

 

 
Powered by phpBB® Forum Software