473,756 Members | 4,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook Redemption

157 New Member
Hello!

Is there someone where who can givme a code example on a Outlook innbox import ta a table in Access using Outlook redemption ?

This is a little bit out-of-my-league programming :)
May 21 '07 #1
6 5716
MrDeej
157 New Member
Please anyone.

I have to get this inbox import working so that i can start desgning the rest of the system.

Now i have surfed around on the web 2 days and tried and tried a million approaches but it just refuses to import my mails to a table..

Kindly Regards a frustrated Eirik
May 22 '07 #2
MrDeej
157 New Member
Like this:
Expand|Select|Wrap|Line Numbers
  1. Dim SafeMailItem, oMailItem
  2. Set SafeMailItem = CreateObject("Redemption.SafeMailItem")
  3. Set oMailItem = Outlook.Session.GetDefaultFolder(10).Items(1)
  4. SafeMailItem.Item = oMailItem
  5. MsgBox SafeMailItem.SenderName 
Should retur me the mail sendername

But it gives me a empty msgbox
May 22 '07 #3
MrDeej
157 New Member
And this code
Expand|Select|Wrap|Line Numbers
  1. dim utils, MailItem, PrSenderEmailAddress, SenderEMail
  2. set utils = CreateObject("Redemption.MAPIUtils")
  3. set MailItem = Application.Session.GetDefaultFolder(6).Items(1)  'Get the first item in the inbox, can be any other item
  4. PrSenderEmailAddress = &H0C1F001E
  5. SenderEMail = utils.HrGetOneProp(MailItem.MAPIOBJECT, PrSenderEmailAddress)
  6. MsgBox SenderEMail 
  7.  
Gives me a mark on the Session in Application.Ses sion.GetDefault Folder(6).Items (1) with a msg of "method or data member not found"

and when i add this as instructed on the web page
Expand|Select|Wrap|Line Numbers
  1. set Application = CreateObject("Outlook.Application")
  2. set Namespace = Application.GetNamespace("MAPI")
  3. Namespace.Logon
  4.  
It gives me the same msg but this time on the GetNameSpace in the Application.Get Namespace("MAPI ")
May 22 '07 #4
MrDeej
157 New Member
Forget it. I just found out that if i change "Applicatio n" to "Outlook" it works!!!
Whooa!! Now i can send mails from VBA without the stupid warning message and 5 second wait


But still not figured out how to import inbox into table
May 22 '07 #5
MrDeej
157 New Member
I am so proud

Expand|Select|Wrap|Line Numbers
  1. Dim rSt As New ADODB.Recordset
  2. Dim MailImport As Object, oMailImport As Object
  3. Dim mottatt As String
  4.  
  5. For i = 1 To 200
  6.  
  7. Set oMailImport = Outlook.Session.GetDefaultFolder(olFolderInbox).Items(i)
  8. Set MailImport = New Redemption.SafeMailItem
  9.  
  10. MailImport.Item = oMailImport
  11.  
  12. mottatt = MailImport.ReceivedTime
  13.  
  14. If IsNull(DLookup("date", "tbl emails", "Date = '" & mottatt & "'")) Then
  15. rSt.Open "[tbl emails]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
  16.         With rSt
  17.             .AddNew
  18.             ![Date] = MailImport.ReceivedTime
  19.             ![fra] = MailImport.Sendername
  20.             ![emne] = MailImport.Subject
  21.             ![Body] = MailImport.Body
  22.             .Update
  23.         End With
  24.     rSt.Close
  25.     Set rSt = Nothing
  26. End If
  27.  
  28. Next
May 22 '07 #6
ADezii
8,834 Recognized Expert Expert
I am so proud

Expand|Select|Wrap|Line Numbers
  1. Dim rSt As New ADODB.Recordset
  2. Dim MailImport As Object, oMailImport As Object
  3. Dim mottatt As String
  4.  
  5. For i = 1 To 200
  6.  
  7. Set oMailImport = Outlook.Session.GetDefaultFolder(olFolderInbox).Items(i)
  8. Set MailImport = New Redemption.SafeMailItem
  9.  
  10. MailImport.Item = oMailImport
  11.  
  12. mottatt = MailImport.ReceivedTime
  13.  
  14. If IsNull(DLookup("date", "tbl emails", "Date = '" & mottatt & "'")) Then
  15. rSt.Open "[tbl emails]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
  16.         With rSt
  17.             .AddNew
  18.             ![Date] = MailImport.ReceivedTime
  19.             ![fra] = MailImport.Sendername
  20.             ![emne] = MailImport.Subject
  21.             ![Body] = MailImport.Body
  22.             .Update
  23.         End With
  24.     rSt.Close
  25.     Set rSt = Nothing
  26. End If
  27.  
  28. Next
GHood for you, MrDeej!
May 22 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4496
by: Anushya | last post by:
Hi All This is the error i am getting when i try to install my addin in some other machine and works fine in development machine. I checked the ..net framework version it is 1.1 in developement and installation machine. Also the outlook version is Outlook 2002 in both development and installation machines. I ma using a listview to populate the mails in this form. lvwDetails is listview. frmIn is the form's name.
7
3303
by: Anushya | last post by:
Hi How to get the id of a name in contact items in outlook. How to do it thru redemption in .net?? i tried the code below. but it shows the error. pls have a look at the code Microsoft.Office.Interop.Outlook.NameSpace oNs; oNs = Connect.oApplication.GetNamespace("MAPI"); //it shows an error here - invalid cast exception
4
19314
by: John | last post by:
Hi Does anyone have a vb.net example of how to use redemption to send mail through outlook? Many Thanks Regards
9
2208
by: John | last post by:
Hi Is it possible to write vb.net code around outlook 2000 dlls and then use the code on ol2002 machines to send emails and bypass ol 2002 email block? Thanks Regards
8
8804
by: John | last post by:
Hi I am using the latest redemption. I am using the below code in vb.net to send mail in html format. The problem is that text does not get sent as html and html tags appear as they are in the message like '<HTML>' etc. Any idea what I am doing wrong? Thanks Regards
2
2451
by: Pieter | last post by:
Hi, I'm using a thight integration with Outlook 2003 (with an Exchange server) in my VB.NET (2005) application. Until now I'm using the Outlook Object Model, but it appears to be very slow, and has some problems: - doing a Move changes the ReceivedTime of the MailItem - I can't use RichText in the MailItem.Body (only allows plain text or HTML) - some other stuff like having to use small 'tricks' to show the default signature in an email
4
10318
by: omrivm | last post by:
Hi, I have a problem with Outlook Redemption, every time I'm trying to create a new RDOAddressBook: Redemption.RDOAddressBook AB = new RDOAddressBook(); I get: "Retrieving the COM class factory for component with CLSID {...GUID...} failed due to the following error: 80040154." I tried to reregister the Redemption DLL but I still get this exception... My OS is win server 2003 sp1 it may be the problem?
6
4757
by: AMP | last post by:
I am trying to write a windows sevice that will send emails. The data is stored in a database and the service scans the database for new entries It work well as a stardard windows app, but when you make is a service it all works except it will not sent the emails Attached is the public sub that should run, its the same code that in the stardard winform, both app's are using Threads
2
5130
by: dlesandrini | last post by:
Now that I have my rant about Google Search out of the way, I can ask my question. Someone must have noticed this, but since I can't Google the Access groups about it, I'll have to just ask: I'm using Redemption to create a SafeItem, and Microsoft Outlook to create a mail item. When an attachment is added, it does get sent to the recipient, but the mail item, when first displayed, doesn't appear to include the attachment. It's there...
6
1985
by: =?Utf-8?B?UmljaA==?= | last post by:
How to suppress the Outlook 2003 security prompts from VB2005. When I tried to look at the body of a message or any other part of an outlook mailItem -- I get these annoying security prompts. I have to loop through several emails a day. Is there some code for suppressing this? I saw some articles about a product called Outlook Redemption which supposed suppresses these messages. I have not tried it. Anyone know how to use it? ...
0
9287
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.