התנצלות

arye9

New member
התנצלות

שאלתי כמה שאלות אך לפני כ20 יום גנבו לי את המחשב (+ המחשב ששמרתי עליו גיבויים) כך שאיני יכול להודות לעונים. תודה אריה
 
קבל את זה כאן

Working with Outlook from Access Outlook comes with a standard set of folders, including folders for its calendar, contacts, deleted items, drafts, e-mail inbox, journal, notes, e-mail outbox, sent e-mail, and tasks. Users can also add custom folders and can nest folders within one another. Users work with items within their folders—adding, deleting, viewing, and performing other functions. Enumerating Items in the Contacts Folder The following procedure manipulates the Contacts folder to enumerate all its items. You can set up a sample Contacts folder with a few entries to evaluate this and subsequent samples. The book´s companion CD also includes some sample contact information for populating a Contacts folder. Sub listContacts() Dim myOlApp As Outlook.Application Dim myNameSpace As NameSpace Dim myContacts As Items Dim myItem As ContactItem ´Create an instance of Outlook. ´Reference its MAPI Namespace. ´Reference MAPI´s Contact folder. Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myContacts = _ myNameSpace.GetDefaultFolder(olFolderContacts).Items ´Enumerate items in Contact folder and ´print selected fields. For Each myItem In myContacts Debug.Print myItem.FirstName, myItem.LastName, _ myItem.Email1Address Next End Sub The procedure starts by declaring four variables: one for the Outlook application, one for its NameSpace object, one for the collection of items in the Contacts folder, and one for enumerating those items. It takes three Set statements to expose the items in the Contacts folder. The last of these uses the GetDefaultFolder method to return the Contacts folder, and it uses the Items property to access the individual items. The enumeration takes place with a For...Each loop. The items in the Contact folder have a series of properties that identify information about contacts. The sample uses three of these properties to print the first name, last name, and first e-mail address for each entry in the Contacts folder. Adding an Item to the Contacts Folder You can also build Access-based solutions that manipulate the contents of the Contacts folder. The first of the next three procedures, addOneContact, inserts a new contact into the folder. It uses string constants to define the first name, last name, and e-mail address for a contact, but you can easily modify the procedure to pass these as arguments. The next two procedures, removeOneEmail and deleteAContact, do just that. The removeOneEmail procedure passes an e-mail address to the deleteAContact procedure, finds a contact item with a matching e-mail address, and then deletes it. Sub addOneContact() Dim myOlApp As Outlook.Application Dim myItem As ContactItem ´Create an instance of Outlook. Set myOlApp = CreateObject("Outlook.Application") ´Create an item for the folder. ´Populate the item with values. ´Save the item. Set myItem = myOlApp.CreateItem(olContactItem) With myItem .FirstName = "foo" .LastName = "bar" .Email1Address = "[email protected]" .Save End With End Sub Sub removeOneEmail() deleteAContact ("[email protected]") End Sub Sub deleteAContact(strEmail) Dim myOlApp As Outlook.Application Dim myNameSpace As NameSpace Dim myContacts As Items Dim myItem As ContactItem ´Create an instance of Outlook. ´Reference its MAPI Namespace. ´Reference MAPI´s Contact folder. Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myContacts = _ myNameSpace.GetDefaultFolder(olFolderContacts).Items ´Enumerate to search for item to delete. For Each myItem In myContacts If myItem.Email1Address = strEmail Then myItem.Delete Exit Sub End If Next ´No entry found MsgBox "No entry found with email of " & strEmail, vbCritical, _ "Programming Microsoft Access 2000" End Sub The procedure requires just two objects—the Outlook Application object and a ContactItem object to represent an item in the Contacts folder. The procedure creates a reference to the Application object with the CreateObject function. This reference supports the CreateItem method, which creates an empty instance of an item for any specified folder. You designate the type of folder for the item using a constant that you pass to the CreateItem method. You can choose from more than 140 properties to specify the characteristics of a contact. The sample assigns string constants for the FirstName, LastName, and Email1Address properties. (Yes, each contact can have more than one e-mail address.) Then it invokes the Save method to store the new entry in the Contacts folder.​
 

arye9

New member
תודה רבה שמוליק

העתקתי את תשובתך ובעוד כמה ימים כשקצת אתארגן אנסה להבין ולהשתמש בה. תודה רבה אריה
 
עלול לא לעבוד

תחת Office XP. חפש באינטרנט אוסף מחלקות אלטרנטיבי שנקרא Redemption, והשתמש בו במקום אוסף המחלקות תחת Outlook.Application. אחרת, Office XP יציג לך הודעה "שמישהו מנסה לגשת לתיבת הדואר שלך מבחוץ ועליך לאשר את הגישה באופן ידני ולזמן מוגבל בלבד עד 10 דקות". שימוש ב-Redemption מונע זאת, והוא גם מאוד פשוט כי הירארכיאת המחלקות זהה לחלוטין לזו שתחת Outlook.Application, אז למעשה כמעט ולא עושים שינויים בקוד. הדבר היחיד שצריך לדאוג לו הוא התקנת ספריית ה-Redemption לפני השימוש בתוכנה שלך כעל מחשב מסויים.
 

arye9

New member
תודה על תשובתך

אני עובד באופי 2000 בכל מקרה אני במצב של שחזור חומר שאבד לי כך שיקח לי הרבה זמן עד שאגיע ללשימוש בתשובות לשאלה האמורה. בכל אופן גם את תשובתך העתקתי ואעשה בה כנראה שימוש בבוא היום. תודה רבה אריה
 
למעלה