![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#3
|
|||
|
|||
![]()
Sorry, Actually I had some code before this that checked that it is there to
find. My problem is that if I place the With itm inside the for loop. When the loop closes do I lose my itm.FullName which I wish to use out of the loop with "With itm"? Hope that my question is making sense. I just recently bought your book and am finding it helpful but I have a long way to go. Thanks "Sue Mosher [MVP-Outlook]" wrote in message ... You are missing any code to test whether itm really was found: If Not itm Is Nothing Then ' update it Else 'create it End If -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Carol G" wrote in message news:aTmbh.386356$1T2.195613@pd7urf2no... I am wishing to capture the itm from the collection when it is found and then overwrite the info using with itm. If it is not found then I wish to set a new itm and add the info. As the code to add or overwrite is the same I was hoping to just have it written once. I think it won't work this way because once I'm out of the for loop my itm is gone. I am very unsure of all this. Thanks for any suggestions. Carol If strDecision = "0" Then For Each itm In itms If strNameList = itm.FullName Then Debug.Print itm.FullName & " is found" End If 'strNameList = itm.FullName Exit For Next with itm **** Here is the problem*** Else ' if decision is new Set itm = itms.Add end if 'Then code for add ing record. 'Standard Contact fields .CustomerID = strCustomerID .FirstName = strFName1 .LastName = strLName1 .CompanyName = strCompName1 .User4 = strCompName2 ... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Newbie question: How to copy an email item from inbox to a folder | Marceepoo | Outlook and VBA | 1 | November 1st 06 06:54 PM |
Deleted Items folder question | 3putt | Outlook Express | 4 | July 4th 06 11:59 AM |
Question about Default Contacts folder | Mervin Williams | Outlook - Using Contacts | 5 | April 13th 06 12:05 AM |
Search Folder Question Please | Bob Newman | Outlook - General Queries | 0 | April 2nd 06 03:34 PM |
.NET AddIn Question UserControl in Folder homepage | David Ing | Outlook and VBA | 8 | March 4th 06 12:24 PM |