|
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;
|
|
|
|
|
Hi,
I'm building a logger for my app:
StackTrace stackTrace= new StackTrace(objException);
StackFrame stackFrame = stackTrace.GetFrame(0);
MethodBase methodBase = stackFrame.GetMethod();
I know I can get the params names with:
methodBase.GetParameters();
How can I get the run time values of the params?
Moreno
|
|
|
|
|
It's not possible to get the values of the parameters through the StackFrame or through reflection.
You could use the ICorDebug[^] interface (more info on MSDN[^]) to get the values. Basically, you would be writing your own debugger. This is the same interface used by Visual Studio.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
But using the System.Diagnostics.StackFrame class will allow you to navigate the stack and by using the meta data you can read the values.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I guess not. It seems you have to use a combination of MSIL and the MethodInfo object. This should allow you up and down the stack but what a mess?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
How can I do that?
Mybe the only way is to send the values with the exeption
Moreno
|
|
|
|
|
You can offset to the stack just like you would when doing inline asm in C++, however, considering the nature of .NET it seems like code that could break really easily.
If you are doing a web method I know a way to log those dynamically with attributes through soap extensions but for normal methods I am out of ideas.
Sending the error values with an exception is a good idea. In fact, your exception should be specifically typed to your needs and not take an empty constructor anyway. Also, if your method takes more than a few (3?) arguments consider creating an object for parameters for the specific method.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|