|
-
Jun 20th, 2002, 08:13 PM
#1
Depends, if your users are using MS Outlook then it would be pretty simple, just add an reference to the MS Outlook object.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jun 21st, 2002, 06:10 PM
#2
Hyperactive Member
Hi, believe it or not there is no actual email address which you can reference from the incoming email via Outlook Objects.
I tried for ages to work this out and finally I figured that you have to create a copy of the incoming mail object, reply to it and from there you can get the email to respond to;
Code:
'oMail is the current mail object (Incoming mail object)
Dim objMessage As Outlook.MailItem
Dim objMessageCopy As Outlook.MailItem
Dim sEmail As String
Set objMessage = oMail
Set objMessageCopy = objMessage.Reply
sEmail = objMessageCopy.Recipients(1).AddressEntry.Address
' sEmail now holds the reply to email address
If anyone has an easier way to get this information, I'm all ears!!!!
Cheers
MarkusJ
-
Jun 25th, 2002, 11:48 AM
#3
Fanatic Member
Markus,
Of the following 3 statements, which one would be considered the "oMail" object?
Set colApp = CreateObject("Outlook.Application")
Set colNameSpace = colApp.GetNamespace("MAPI")
Set colFolders = colNameSpace.GetDefaultFolder(olFolderInbox)
Thanks,
Jeff
-
Jun 25th, 2002, 01:32 PM
#4
Fanatic Member
Markus,
I tried your code and I'm not sure if I got it right. Look at my previous message post. I have also attached a screen print of the program. What is supposed to show up in the "E-mail Messages" window are Recipient Email Addresses. Only 1 shows up the way I want it to.
Any ideas?
Thanks,
Jeff
-
Jun 26th, 2002, 04:50 PM
#5
Fanatic Member
-
Jun 27th, 2002, 11:54 AM
#6
Fanatic Member
Does anybody have any idea???
-
Jun 29th, 2002, 01:26 AM
#7
Hyperactive Member
Hi Jeffo..
The following is a piece of code which goes through all the messages in your inbox, looks for a specific subject and then raises an event and passes the current mailobject to a routine.
If you use this inconjunction with the code I posted earlier you should be ok 
Code:
' Variables used to create the outlook object
Private myOLApp As New Outlook.Application
Private olNameSpace As Outlook.NameSpace
Private myFolder As Outlook.MAPIFolder
Private olMapi As Object
' Subroutine which is used to go through all the emails in the inbox
Public Sub traverse()
Dim i As Integer
Dim strSubject As String
Dim strSender As String
Dim strBody As String
Dim strOwnerBox As String
' For each email in the inbox
For i = 1 To myFolder.Items.Count
' get the subject
strSubject = myFolder.Items(i).Subject
' If the subject is a reponse from the internet site then
If Trim(strSubject) = "|product-purchase|" Then
' Raise the ResponseMail event which will extract all information from the email
' and store the information into the database
RaiseEvent ResponseMail(myFolder.Items(i).SenderName, myFolder.Items(i).Body, myFolder.Items(i).ReplyRecipientNames)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This is the oMail object here
RaiseEvent LogResponse(myFolder.Items(i))
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End If
Next
End Sub
HTH
Regards
Mark
-
Jul 1st, 2002, 03:09 PM
#8
Fanatic Member
Mark,
I believe your code will work, but I'm not real sure how to integrate it with the code you gave me before.
JO
-
Jul 1st, 2002, 05:12 PM
#9
Hyperactive Member
Hi Jeffo, attached is a form which allows a user to click on a button. All the emails in the Inbox of outlook are then added to a listbox for you to view. To use it create a new project and add the form in, run the form click on the button and all the emails that are in your Inbox should appear in the listbox.
I just wrote this real quick but it should be enough to get you going 
Don't forget to add a reference to the Microsoft Outlook object library (Im using Microsoft Outlook 9.0 object library)
Cheers
Mark
-
Jul 2nd, 2002, 09:10 AM
#10
Fanatic Member
Markus,
I really appreciate your help in this matter. I did what you said
and unfortunately, it didn't display the email addresses. I've attached a print screen of what the results are. Maybe there are some settings that need to be changed on my computer or something.
Thanks again!
Jeff
-
Jul 2nd, 2002, 06:39 PM
#11
Hyperactive Member
Hi Jeffo, Damn thats weird!!
The code that I wrote works ok under Windows 2000 along-side Microsoft Outlook 2000. Unfortunately thats all I have access to...
Whats specs are you using???
Cheers
Mark
-
Jul 3rd, 2002, 11:32 AM
#12
Fanatic Member
Markus,
I'm developing the specs myself. I am running Windows NT and using MS Outlook 97. That output is really strange. I don't know what else to do. How bout you?
Jeff
-
Jul 3rd, 2002, 04:47 PM
#13
Hyperactive Member
Hi Jeff, Sorry mate, that really has me baffled
I only have access to outlook 2000 under windows 2000 proferssional...
I really am out of ideas now 
Hope you get it going somehow
Cheers
Markus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|