Updating address book in outlook

06 Jan

When deciding to include automation in your app, you have to consider how your users will be using it. As long as these names can be resolved within the current Address List, the recipient is considered valid.If your application is already established with your users and has a known user interface, its probably best to link to another application to provide additional functionality. If a recipient isn't valid, then the message will not be sent.The object-oriented features serve developers well, reducing the code required to perform various functions. Many times when building an application, I pull forms and ideas from other applications, reusing these pieces as well. If the Resolve method isn't called, the meeting request may be delayed in sending.Instead of just sticking to existing code, why not consider using an existing application to reduce all your hard effort? In the above example, the last Recipient isn't a single person: it's a Distribution list.Conversation Topic ln = ln 1 ENDIF ENDFOR MESSAGEBOX("You are having " LTRIM(STR(ALEN(la Conversations,1))) " conversations in this folder.") Replying and Forwarding Messages Call the Reply method to create a message that has all of the recipient information filled in based on the current message. Recipients When sending and receiving messages, the Recipients collection contains any person receiving the message, including any CC (carbon copys) or BCCs. Once a recipient has been added, call the Resolve method to verify the person. For example, Inbox messages are usually viewed with the Messages or Unread Messages view.

So in the case of a series of messages as shown in figure 1, the conversation topic is always the same. It is supposed to contain the Index of the conversation. A message may not have the same Subject and yet belongs to the same conversation. Values are: 0 Non Meeting 1 Meeting 2 Meeting Cancelled 3 Meeting Received Scheduling Meetings To schedule a meeting, you must send the Appointment item to the appropriate recipients as well as Save it. Inspector and Explorer objects have some common properties and methods: Caption returns the form caption displayed to the user Close closes the form Display displays the form or refreshes the view Activate activates the form The Explorer object also has Current View and Current Folder properties.

The Outlook Application object exposes a few properties that are used to access the rest of Outlook, the most important one is the Name Space object. Items The lo App statement creates the Application object. Common Item Methods All items have standard methods that can be used for moving items around. Deleted items are placed in the Deleted Items folder. You can add an attachment as a shortcut to the item, a direct attachment or as an embedded Outlook object. When you create a message, the most likely method to use is Send. Each Recipient in the collection has thee properties: Name, Address and Type. Contacts The Contact Item represents a placeholder for any information you want to track about a person. When you delegate a task, you are, in effect, sending them a message with the details of the task, asking them to take ownership of it. If the assignee (in this case, John Smith) refuses the assignment, the Delegation State is automatically updated to 3. The following code returns a list of tasks, waiting to be assigned: FOR EACH lo Task IN o Tasks. The first parameter to the Add method is the name of the custom field. After moving to the first or last item, call Get Next or Get Previous to move up and down through the folder. Call the Find Next method to find the next occurrence based on your current item position. For example, a list of messages or contacts is displayed in Outlook with an Explorer.

The Name Space object is a reference to the current Outlook data source or session. Lo Space returns a reference to the current Outlook session. Name ENDFOR Folders are hierarchical so each folder can contain their own set of folders as well. To permanently delete items, delete items that are in the Deleted Items folder. Get Default Folder(3) ln Items = trashfolder.items.count For lni = l TO ln Items Trashfolder.items(0).delete() Endfor Call the Copy method to create a copy of the message. Copy() The Move method then moves the message into another folder. However, if you call Save, it will save a copy of the message. For a single contact, you can store 3 mailing addresses, 3 e-mail addresses, 19 different contact numbers and many more pieces of personal information. The following code delegates a task to another user: lo Task = o Tasks. The second parameter is the type of field you are adding. You can specify that a custom field must be one of the types above. When you double-click a contact, it appears in a form that is controlled by an Inspector.

DEFINE CLASS Out Track AS custom OLEPUBLIC Name = "Out Track" PROCEDURE writelog LPARAMETERS tc Info IF EMPTY(tc Info) tc Info = "" ENDIF =STRTOFILE(tc Info " " TTOC(DATETIME()) ; " " SYS(0) CHR(13),"\OUTLOOK. T.) ENDPROC ENDDEFINE Create a project named OUTCOME and add this as program MAIN. To test the code, try the following code: X = createobject(Outcome. Write Log(My Outlook automation tracker) Building the Customized Form Our next step is to build the Customized Form. The Outlook controls are also available to you in Visual Fox Pro!

They are the Active X controls named Microsoft Forms.