>>I am importing emails into my application and storing the details in a foxpro table. I want to be able to access the actual email message in outlook from foxpro.
>>
>>Many thanks for any help
>
>I'm sorry for your losses in the London tragedy.
>England and Portugal have the oldest aliance in the western civilization, it lasts for 9 centuries, although the British people don't remember it. In Portugal we really feel any attack to United kingdom.
>
>Back to your problem...
>Here is some code that might help you:
>
>
>* Connect to Outlook
> aplicacao = createobject("outlook.application")
> espaco = aplicacao.GetNamespace("MAPI")
>
>* Instantiate 'Inbox' folder
> inbox = espaco.GetDefaultFolder(6)
>
>* Instantiate 'Deleted Items' folder
> eliminados = espaco.GetDefaultFolder(3)
>
>* Count messages in Inbox
> Contagem = inbox.Items.Count
>
>* Navigate messages
> for i = 1 to contagem
>
> * Get specific message
> mensagem = inbox.items(i)
>
> * Read message 'subject' field
> assunto = mensagem.subject
>
> * Count attachments
> total_attachments = mensagem.attachments.count
>
> * Read attachments and save it to a disk folder
> if total_attachments > 0
>
> * Browse through attachments
> for x = 1 to total_attachments
> nomeficheiro = ;
> mensagem.attachments(x).filename
> nomeficheiro2 = "c:\temp\" + m.nomeficheiro
> mensagem.attachments(x).saveasfile(nomeficheiro2)
> next
> endif
>
> * Move the complete message to deleted items
> * remember that object 'eliminados' is an instance to
> * 'deleted items' folder
> mensagem.Move(eliminados)
>
> mensagem = null
> assunto = null
> next
> wait clear
>
>* Close outlook
> aplicacao.quit
>
>* Release objects
> aplicacao = null
> espaco = null
> inbox = null
> Contagem = null
> eliminados = null
> mensagem_segura = null
>
>
>Note that Outlook, for security reasons, don't expose all it's objects.
>
>To get some objects that Outlook don't expose i use a class called Redemption, if you want to look at it, send me a message and i reply to you.
>
>Joaquim
Thank you for yor message. Its a shame that a minority can cause such pain in our beautiful world.
I am already storing the contents of my outlook messages in a foxpro table but i am wanting to store a unique reference for each email so i can open a particular email in outlook. Any feedback is most welcome
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only