FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How get message from dbx (Outlook Express)
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
How get message from dbx (Outlook Express)
Posted: Mon Apr 30, 2007 10:57 PM

Hi, i need to know all the folders and messages in the outlook express or microsoft outlook or more in general in the default mail of pc.

I found the following exampe for microsoft outlook and in tried to implement it.


oOL := TOleAuto():New( "Outlook.Application" )
lOutlookOK := .T.
IF ! lOutlookOK
RETURN ( 0 )
ENDIF

oNameSpace = oOL:Get( "GetNameSpace", "MAPI" )
oContacts = oNameSpace:Get( "GetDefaultFolder", "6" ) // 6 = Inbox-Folder

FOR nContador = 1 TO oContacts:ITEMS:Count()
oNewContact = oContacts:ITEMS( nContador )
cSenderName := oNewContact:get( "SenderName" )
cSubject := oNewContact:get( "Subject" )

cBody := oNewContact:get( "Body" )
NEXT nContador
RETURN NIL


of course i dont know how to complete it.
I need for example to have all the folders of default mail (express/outlook/other) and the message and all the other information from an email/msg

Tks
Romeo

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
How get message from dbx (Outlook Express)
Posted: Mon Apr 30, 2007 11:46 PM

Romeo,

Outlook Express is not OLE capable.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
How get message from dbx (Outlook Express)
Posted: Wed May 02, 2007 04:09 PM

Ok,
Could be possible to have a sample (for microsoft outlook) to get all the folders of mail and all the message.

I tried to have a look in the file VBAOUTL*.CHM, but i am not able to get the right informations.

tks

Posts: 2
Joined: Wed May 02, 2007 04:30 PM
How get message from dbx (Outlook Express)
Posted: Thu May 03, 2007 03:54 PM

This is a VBA Macro where I inserted some code to get all Emails from a folder.
Regards
Otto

Sub SaveEmail()
'Declaration
Dim itm As Outlook.MailItem

Set olItms = Application.ActiveExplorer.CurrentFolder.Items

On Error Resume Next
For Each itm In olItms
MsgBox (itm.SenderEmailAddress)
Next itm

End Sub

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
How get message from dbx (Outlook Express)
Posted: Thu May 03, 2007 04:01 PM

tks, in VBA it seems very simple.
But i use fwh, i tried
Romeo

Posts: 2
Joined: Wed May 02, 2007 04:30 PM
How get message from dbx (Outlook Express)
Posted: Thu May 03, 2007 06:05 PM

What for do you need this?
In my case I save the emails with a macro and than use a FW program with a timer which looks up the folder where the emails are saved.

Regards
Otto

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
How get message from dbx (Outlook Express)
Posted: Fri May 04, 2007 04:02 PM

It seems a god idea.
Of course i need VB...
Tks

Continue the discussion