using Microsoft.Office.Core; using Outlook; using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Web; using System.Web.Services; (...) [WebMethod(Description="Returns the contacts data found from last name, first name and company.")] public long getContacts(string whichLastName, string whichFirstName, string whichCompany) { long buffAnswer = 0; Outlook.Application buffApp; Outlook.NameSpace buffNameSpace; Outlook.MAPIFolder buffFolder; Outlook.ContactItem buffContact; buffApp = new Application(); // ici ça ne va pas !!! buffNameSpace = buffApp.GetNamespace("MAPI"); buffFolder = buffNameSpace.GetDefaultFolder( Outlook.OlDefaultFolders.olFolderContacts); buffAnswer = buffFolder.Items.Count; return buffAnswer; }
> using Microsoft.Office.Core; > using Outlook; > using System; > using System.Collections; > using System.ComponentModel; > using System.Data; > using System.Diagnostics; > using System.Web; > using System.Web.Services; > > (...) > > [WebMethod(Description="Returns the contacts data found from last name, first name and company.")] > public long getContacts(string whichLastName, > string whichFirstName, string whichCompany) { > long buffAnswer = 0; > > Outlook.Application buffApp; > Outlook.NameSpace buffNameSpace; > Outlook.MAPIFolder buffFolder; > Outlook.ContactItem buffContact; > > buffApp = new Application(); // ici ça ne va pas !!! > buffNameSpace = buffApp.GetNamespace("MAPI"); > buffFolder = buffNameSpace.GetDefaultFolder( Outlook.OlDefaultFolders.olFolderContacts); > > buffAnswer = buffFolder.Items.Count; > > return buffAnswer; > } >
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question