| | |
VB6 - Look up email address from outlook address book?
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi tgif,
use this code:
Regards
Veena
use this code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim TItem As ListItem If lvw.SelectedItem.text <> "" Then Set TItem = lvw.SelectedItem EMailID=TItem.SubItems(2) Else MsgBox "No Item Selected From list" End If
Regards
Veena
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Good morning Veena.
Thanks for your numerous contributions. I put the codes below inside my form load() module, because I want the listview control to get populated on form load then I can select and email from the list then click the sendEmail button.
However, when I tried to compile, I get Error msg: Run-Time error 380 -Invalid property value:
This line of code generates the error:
Below is my form load module:
Thanks,
tgifgemini
Thanks for your numerous contributions. I put the codes below inside my form load() module, because I want the listview control to get populated on form load then I can select and email from the list then click the sendEmail button.
However, when I tried to compile, I get Error msg: Run-Time error 380 -Invalid property value:
This line of code generates the error:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address
Below is my form load module:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Form_Load() Set OutlookApp = New Outlook.Application Set OutlookMailItem = OutlookApp.CreateItem(olMailItem) Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI") For Each OutlookAddressList In OutlookNameSpace.AddressLists For Each OutlookAddressEntry In OutlookAddressList.AddressEntries lvw.ListItems.Add , , OutlookAddressEntry.Name lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address lvw.ListItems(lvw.ListItems.Count).SubItems(2) = OutlookAddressEntry.ID lvw.ListItems(lvw.ListItems.Count).Tag = OutlookAddressEntry.ID Next Next End Sub
tgifgemini
Hi,
Just change the code:
Set lvw.ReportType = lvwReport
Regards
Veena
Just change the code:
Set lvw.ReportType = lvwReport
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim X As ListItem Set OutlookApp = New Outlook.Application Set OutlookMailItem = OutlookApp.CreateItem(olMailItem) Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI") For Each OutlookAddressList In OutlookNameSpace.AddressLists For Each OutlookAddressEntry In OutlookAddressList.AddressEntries set X= lvw.ListItems.Add( , , OutlookAddressEntry.Name) X.SubItems(1) = OutlookAddressEntry.Address X.SubItems(2) = OutlookAddressEntry.ID X.Tag = OutlookAddressEntry.ID Next Next
Regards
Veena
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Good morning Veena,
how are you doing today? I really do appreciate all your assistance. I plugged in recent code you you gave me and I am getting same "RunTime error 380 - Invalid property value". I am going nuts with this Microsoft stuff that is not telling you what the actual problem is.
And I don't know where else to look.
Thanks.
tgifgemini
how are you doing today? I really do appreciate all your assistance. I plugged in recent code you you gave me and I am getting same "RunTime error 380 - Invalid property value". I am going nuts with this Microsoft stuff that is not telling you what the actual problem is.
And I don't know where else to look.
Thanks.
tgifgemini
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Good morning Veena,
how are you doing today? I really do appreciate all your assistance. I plugged in recent code you you gave me and I am getting same "RunTime error 380 - Invalid property value" on this line of code: and a compile error: "Method or Data member not found" on this line: [Set lvw.ReportType = lvwReport[/code]I am going nuts with this Microsoft stuff that is not telling you what the actual problem is.
And I don't know where else to look.
Question: Shouldn't I first Dimension "lvw" as something before the 'set lvw.ReportType = lvwReport' statement?
Thanks.
tgifgemini
how are you doing today? I really do appreciate all your assistance. I plugged in recent code you you gave me and I am getting same "RunTime error 380 - Invalid property value" on this line of code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
x.subItems(1) = OutlookAddressEntry.Address
And I don't know where else to look.
Question: Shouldn't I first Dimension "lvw" as something before the 'set lvw.ReportType = lvwReport' statement?
Thanks.
tgifgemini
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Veena,
Actually, I went ahead and created ListView header columns which I didn't have initially, therefore since I want to display 3 items in the columns, it didn't find any columns to append the items.
This is what I did:
And it populated the ListView with the the physical names "gift, xtian" etc.
So I used the first subscript(1) as the address and it worked like magic.
Thanks.
You're a true trooper for holding my hand all along.
tgifgemini.
Actually, I went ahead and created ListView header columns which I didn't have initially, therefore since I want to display 3 items in the columns, it didn't find any columns to append the items.
This is what I did:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'create columns lvw.ColumnHeaders.Clear lvw.ColumnHeaders.Add , ,"Address" lvw.ColumnHeaders.Add , ,"ID"
And it populated the ListView with the the physical names "gift, xtian" etc.
So I used the first subscript(1) as the address and it worked like magic.
Thanks.
You're a true trooper for holding my hand all along.
tgifgemini.
Hi,
OK, its:
lvw.view=3
And u have to add column headers..
Write this code b4 populating the list..
Sorry for the inconvinience..
Regards
Veena
OK, its:
lvw.view=3
And u have to add column headers..
Write this code b4 populating the list..
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim lvwColumn As ColumnHeader lvwColumn = New ColumnHeader() lvwColumn.Text = "Name" lvw.Columns.Add(lvwColumn) lvwColumn = New ColumnHeader() lvwColumn.Text = "Address" lvw.Columns.Add(lvwColumn) lvwColumn = New ColumnHeader() lvwColumn.Text = "ID" lvw.Columns.Add(lvwColumn)
Sorry for the inconvinience..
Regards
Veena
•
•
Join Date: Jun 2007
Posts: 166
Reputation:
Solved Threads: 9
Hello All.
You people are waisting your time and energy. And I can't understand, why people gives in this thread so many type of codes, telling one way or the other I am soory, please change to this, please omit that etc. without first understanding the basic of it or trying the code themselves! If you have heeded to my advice in this forum by telling gemini that the answer is NO as well as Yes.
I will put it briefly below. Think about it and answer me.
First of all, if you are thinking Outlook Express, just forget it. The only three ways of integrating with Outlook Express are (and this is just my guessing) by paying Microsoft a lot of money and by giving them a really good reason to why you want to do that, or by hooking in through the encryption-entry, or by creating a proper hook and hacking your way in there.
Could you make out any thing from the bold entries above?
Happy Programming
AV Manoharan
You people are waisting your time and energy. And I can't understand, why people gives in this thread so many type of codes, telling one way or the other I am soory, please change to this, please omit that etc. without first understanding the basic of it or trying the code themselves! If you have heeded to my advice in this forum by telling gemini that the answer is NO as well as Yes.
I will put it briefly below. Think about it and answer me.
First of all, if you are thinking Outlook Express, just forget it. The only three ways of integrating with Outlook Express are (and this is just my guessing) by paying Microsoft a lot of money and by giving them a really good reason to why you want to do that, or by hooking in through the encryption-entry, or by creating a proper hook and hacking your way in there.
Could you make out any thing from the bold entries above?
Happy Programming
AV Manoharan
•
•
Join Date: Jun 2007
Posts: 166
Reputation:
Solved Threads: 9
•
•
•
•
Hi AV Manoharan,
I don't know what you are babbling about, but Veena have correctly answered my question, so be cool.
tgifgemini.
regards
AV Manoharan
![]() |
Similar Threads
- VB 6.0 - Accepting value (email address)from Inputbox (Visual Basic 4 / 5 / 6)
- outlook 03 email address read as word; duplicate email (Windows Software)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: separating lines in vb6 using richtextbox
- Next Thread: where-like in vb6
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





