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 :)
6 5716
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
Like this: - Dim SafeMailItem, oMailItem
-
Set SafeMailItem = CreateObject("Redemption.SafeMailItem")
-
Set oMailItem = Outlook.Session.GetDefaultFolder(10).Items(1)
-
SafeMailItem.Item = oMailItem
-
MsgBox SafeMailItem.SenderName
Should retur me the mail sendername
But it gives me a empty msgbox
And this code - dim utils, MailItem, PrSenderEmailAddress, SenderEMail
-
set utils = CreateObject("Redemption.MAPIUtils")
-
set MailItem = Application.Session.GetDefaultFolder(6).Items(1) 'Get the first item in the inbox, can be any other item
-
PrSenderEmailAddress = &H0C1F001E
-
SenderEMail = utils.HrGetOneProp(MailItem.MAPIOBJECT, PrSenderEmailAddress)
-
MsgBox SenderEMail
-
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 - set Application = CreateObject("Outlook.Application")
-
set Namespace = Application.GetNamespace("MAPI")
-
Namespace.Logon
-
It gives me the same msg but this time on the GetNameSpace in the Application.Get Namespace("MAPI ")
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
I am so proud - Dim rSt As New ADODB.Recordset
-
Dim MailImport As Object, oMailImport As Object
-
Dim mottatt As String
-
-
For i = 1 To 200
-
-
Set oMailImport = Outlook.Session.GetDefaultFolder(olFolderInbox).Items(i)
-
Set MailImport = New Redemption.SafeMailItem
-
-
MailImport.Item = oMailImport
-
-
mottatt = MailImport.ReceivedTime
-
-
If IsNull(DLookup("date", "tbl emails", "Date = '" & mottatt & "'")) Then
-
rSt.Open "[tbl emails]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
-
With rSt
-
.AddNew
-
![Date] = MailImport.ReceivedTime
-
![fra] = MailImport.Sendername
-
![emne] = MailImport.Subject
-
![Body] = MailImport.Body
-
.Update
-
End With
-
rSt.Close
-
Set rSt = Nothing
-
End If
-
-
Next
ADezii 8,834
Recognized Expert Expert
I am so proud - Dim rSt As New ADODB.Recordset
-
Dim MailImport As Object, oMailImport As Object
-
Dim mottatt As String
-
-
For i = 1 To 200
-
-
Set oMailImport = Outlook.Session.GetDefaultFolder(olFolderInbox).Items(i)
-
Set MailImport = New Redemption.SafeMailItem
-
-
MailImport.Item = oMailImport
-
-
mottatt = MailImport.ReceivedTime
-
-
If IsNull(DLookup("date", "tbl emails", "Date = '" & mottatt & "'")) Then
-
rSt.Open "[tbl emails]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
-
With rSt
-
.AddNew
-
![Date] = MailImport.ReceivedTime
-
![fra] = MailImport.Sendername
-
![emne] = MailImport.Subject
-
![Body] = MailImport.Body
-
.Update
-
End With
-
rSt.Close
-
Set rSt = Nothing
-
End If
-
-
Next
GHood for you, MrDeej!
Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
|
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
|
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
|
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
|
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
| |
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
|
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?
|
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
|
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...
|
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?
...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
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();...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |