|
s3rro wrote: But I cant find the object under OutlookItems to print the whole contacts list.
They hide that information in the documentation[^]
|
|
|
|
|
I read the document.
I can get the first/last contact. I tried most of them to list the whole Outlook Contacts, list none worked, thats why i asked it here.
Thanks
|
|
|
|
|
s3rro wrote: I tried most of them to list the whole Outlook Contacts, list none worked
I have no idea what that means ????
|
|
|
|
|
Ok,
When i run the code with getLast or getFirst "(Outlook.ContactItem)oItems.GetLast();" everything is good, it pops up Outlook contacts window with the last contact in the list. But you are not able to go up and down on your contacts list.
Normally when you open the contacts window from the Outlook you are able go up/down to check the other contacts.
Now i am looking for the object to view the "main outlook contacts window" or a way to print the whole outlook contacts to a textbox (with whatever i need from the contacts name+lastname phonenumbers) I have in my application.
|
|
|
|
|
s3rro wrote: Ok,
When i run the code with getLast or getFirst "(Outlook.ContactItem)oItems.GetLast();" everything is good, it pops up Outlook contacts window with the last contact in the list. But you are not able to go up and down on your contacts list.
Normally when you open the contacts window from the Outlook you are able go up/down to check the other contacts.
Now i am looking for the object to view the "main outlook contacts window" or a way to print the whole outlook contacts to a textbox (with whatever i need from the contacts name+lastname phonenumbers) I have in my application.
I have no idea what you mean as I have not read the documentation. But, I would image that it would require some iteration to get every single contact from the address book.
I would think something like:
for(int i = 0; i < (oItems.Items.Count; i++)
{
Console.WriteLine(string.format("Contact {0}'s name is: {1}", i.ToString(), oItems.Items[i].ContactName));
}
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
s3rro wrote: But you are not able to go up and down on your contacts list.
What does that mean? State your problem specifically, can you do that?
|
|
|
|
|
ok, In outlook when you open your contacts ( go>contacts or ctrl+3)
then click on a contact on the new window you have up/down arrows to go to the previous and the next contact.Those buttons do not function when i open the contacts window with
"Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetLast();"
or
"Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetFirst();"
then I planned to print my whole outlook contacts to checkedtextbox in my application but couldnt find the what the "Outlook - whole contact list" is called to print it to my textbox.
up/down buttons on the contacts window is = previous and the next item from the contacts list.
Thanks for your help in advance
|
|
|
|
|
s3rro wrote: ok, In outlook when you open your contacts ( go>contacts or ctrl+3)
then click on a contact on the new window you have up/down arrows to go to the previous and the next contact.Those buttons do not function when i open the contacts window with
"Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetLast();"
or
"Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetFirst();"
then I planned to print my whole outlook contacts to checkedtextbox in my application but couldnt find the what the "Outlook - whole contact list" is called to print it to my textbox.
up/down buttons on the contacts window is = previous and the next item from the contacts list.
I think I understand what you want to do. You want to add every contact from your list to a checked-text box. Create a "contact" object. Then iterate through the items in the object, strip out what you want/need and add it to your controls. Is that what you want to do?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Yes thats what exactly I want to do.
I want to strip out the parts that i dont need from the Outlook Contacts. I ll keep the name+last name and phone number fields and print it to a checkedlistbox in my application.
Thank you
|
|
|
|
|
Ah I see now. See led mike's post below, he posted a link showing how to do exactly what you want to do.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
s3rro wrote: but couldnt find the what the "Outlook - whole contact list" is called to print it to my textbox.
Ah.... see this[^]
|
|
|
|
|
Thanks the link was very helpful.And right now im able get the number of the contact in my outlook.
Now i want to list them in a checkedListBox. How can I do it?
this is what i used to retrieve the number of Outlook contacts.
Outlook.MAPIFolder foldercontacts = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
Outlook.Items searchFolder = foldercontacts.Items;
int counter = 0;
foreach (Outlook.ContactItem foundContact in searchFolder)
{
counter = counter + 1;
//foundContact.FullName.ToString();
}
MessageBox.Show("You have" + counter + "contacts" );
thanks in advance
|
|
|
|
|
I have created a XML view application with a few other things in it and am I now more or less 'done' but i just found out you can't resize it. I have 'locked' set to false on my Form but it still wont let me resize
|
|
|
|
|
Check that the FormBorderStyle is set to Sizable
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
|
Ok I found the Boarder Style and it is set to Sizeable, anyone else have an idea?
|
|
|
|
|
You could have restricted it by setting MaximumSize and MinimumSize properties of your form to the same value
|
|
|
|
|
nope
|
|
|
|
|
Check the following places for properties like FormBorderStyle, MaximumSize, etc...
Look in the InitializeComponent code for the section "// ClassName"
Look in the default public constructor
Look in any overloaded or event subscribed load/shown methods
...
Also ensure that the form size is not bound to some data object (click "DataBindings" in the designer to check)
Also check that you call base.OnResize, base.SizeChanged, etc. if you overload any of those methods
Finally, check that you don't reset the size in subscribed events like Resize, SizeChanged, etc.
Let us know if any of the above worked.
Jeff
|
|
|
|
|
Hi,
I am listing some names + phone numbers in a textbox and I want to add checkboxes beside them to choose multiple contacts from the list.
How can I add a check box on the left side of each name while the list of the names+ phone numbers are listed in the test box.
Thanks
|
|
|
|
|
|
Hello,
Is the CheckedListBox[^] what you are looking for?
All the best,
Martin
|
|
|
|
|
How about using a CheckBoxList (which exactly fits your requirement) rather than a multiline textbox (which exactly doesn't)?
[edit] 3 same answers on the same minute. Thats gotta be a record!
|
|
|
|
|
Thanks I ll try the checkBoxList
You guys are very fast
|
|
|
|
|
It works now what I really want to do is printing my outlook contacts to this CheckedListBox.
Right now I can pop the Outlook Contacts from my application with the below code.
I wonder how can i print the names + fax numbers only in that checkedlistBox
Thanks
try
{
Outlook.Application oApp = new Outlook.Application();
// Get the NameSpace information.
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
// Log on by using a dialog box to choose the profile.
oNS.Logon(System.Reflection.Missing.Value, System.Reflection.Missing.Value, true, true);
// Get the default Contacts folder.
Outlook.MAPIFolder oContacts = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
// Get the Items collection from the folder.
Outlook.Items oItems = (Outlook.Items)oContacts.Items;
// Get the first contact item in the Items collection.
Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetLast();
string faxNum;
faxNum = oCt.BusinessFaxNumber.Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", "");
this.txtRecipientFax.Text = faxNum;
|
|
|
|