请问OUTLOOK的通讯录怎么读取,有什么接口 如题,看过以前的贴,没有找的解决方法。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Just a small exampleVariant Outlook = CreateOleObject( "Outlook.Application" );Variant MAPINamespace = Outlook.OleFunction( "GetNamespace", "MAPI" );Variant contactsFolder = MAPINamespace.OleFunction( "GetDefaultFolder", olFolderContacts );Variant contactItems = contactsFolder.OlePropertyGet( "Items" );Variant contactItemsCount = contactItems.OlePropertyGet( "Count" );for( int i = 1; i <= contactItemsCount; i++ ){ Variant contactItem = contactItems.OleFunction( "Item", i ); for( int j = 0; propertyList.setCurrent( j ); j++ ) { Variant propertyValue = contactItem.OlePropertyGet( "FullName" ); }}jingjing_123 can refer this document from MSDNIn additon to it,the following is a LISTOlePropertyGet with one of these values:TitleFirstNameMiddleNameLastNameSuffixFullNameCompanyNameDepartmentJobTitleBusinessAddressStreetBusinessAddressCityBusinessAddressStateBusinessAddressPostalCodeBusinessAddressBusinessAddressCountryHomeAddressStreetHomeAddressCityHomeAddressStateHomeAddressPostalCodeHomeAddressHomeAddressCountryOtherAddressStreetOtherAddressCityOtherAddressStateOtherAddressPostalCodeOtherAddressOtherAddressCountryAssistantTelephoneNumberBusinessTelephoneNumberBusiness2TelephoneNumberBusinessFaxNumberCallbackTelephoneNumberCarTelephoneNumberCompanyMainTelephoneNumberHomeFaxNumberHomeTelephoneNumberHome2TelephoneNumberISDNNumberMobileTelephoneNumberOtherFaxNumberOtherTelephoneNumberPagerNumberPrimaryTelephoneNumberRadioTelephoneNumberTTYTDDTelephoneNumberTelexNumberAccountAnniversaryAssistantNameBillingInformationBirthdayBusinessAddressPostOfficeBoxCategoriesChildrenEmail1AddressEmail1AddressTypeEmail1DisplayNameEmail2AddressEmail2AddressTypeEmail2DisplayNameEmail3AddressEmail3AddressTypeEmail3DisplayNameGender //Unspecified=0, Female=1, Male=2GovernmentIDNumberHobby HomeAddressPostOfficeBoxInitialsInternetFreeBusyAddressLanguageManagerNameMileageOfficeLocationOrganizationalIDNumberOtherAddressPostOfficeBoxImportance //Priority: Low=0, Normal=1, High=2ProfessionReferredBySensitivity //Private: Normal=0, Personal=1, Private=2, Confidential=3SpouseUser1User2User3User4WebPage 这个是发邮件的吗??明明是contract操作啊 o sorry,连接的网址是自动发邮件的,但是你贴出来的代码部分,但是 这个提示 “Variant” 未声明的标识符 MFC 里没有种类型的变量 Tr0j4n, VARIANT atl头文件什么意思?要加载哪个头文件,知识浅薄,请说明白一些,谢谢 我给你贴的那个MSDN文档你看下,还有有的问题你可以去Google,MSDN。不用每个问题都面面俱到地问 pContact->GetEmail1Address()是获取邮件地址,这你也看到了吧?根据1#下面的那些属性进行填充 我的是Outlook Express 用的是第一种方法,第二种 #import "e:\Program Files\Microsoft Office\Office\mso9.dll" named_guids#import "e:\Program Files\Microsoft Office\Office\MSOUTL9.olb" \ no_namespace exclude("_IRecipientControl", "_DRecipientControl")这两个库文件都找不到 google vc outlook.applicationhttp://topic.csdn.net/t/20050620/20/4095077.html ::CoInitialize(NULL); { _ApplicationPtr spOutlook("Outlook.Application"); _NameSpacePtr spNamespace = spOutlook->GetNamespace("MAPI"); MAPIFolderPtr spFolder = spNamespace->GetDefaultFolder(olFolderContacts); _ItemsPtr spItems = spFolder->GetItems(); _ContactItemPtr spContact; char s[200]={0}; for(int i=1;i<=spItems->Count;++i) { spContact = spItems->Item(i); sprintf(s, "%s%s", _com_util::ConvertBSTRToString(spContact->Subject), _com_util::ConvertBSTRToString(spContact->MobileTelephoneNumber)); //AfxMessageBox(_T(s)); } spContact = NULL; spItems = NULL; spFolder = NULL; spNamespace = NULL; spOutlook = NULL; } ::CoUninitialize();为什么 _ApplicationPtr spOutlook("Outlook.Application"); 运行的时候报错 :ReadBookFromOutlook.exe 中的 0x7c812a6b 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0013f18c 处的 _com_error。ReadBookFromOutlook.exe 中的 0x7c812a6b 处未处理的异常: Microsoft C++ 异常: 内存位置 0x0013f18c 处的 _com_error。 你引用dll了么??还有outlook应该在你机器有装 引用了,在stdafx.h里#import “C:/Program Files/Common Files/Microsoft Shared/OFFICE11/mso.dll” rename_namespace(”Office”), named_guids#import “C:/Program Files/Microsoft Office/Office11/MSOUTL.olb” rename_namespace(”Outlook”), named_guidsusing namespace Office;using namespace Outlook;但是系统找不到MSOUTL.olb文件,我在网上下了一个,可以编译通过,但是运行,就报上面的错 oe6似乎不支持vba 你看看http://blog.sina.com.cn/s/blog_4c62562801000bhw.html或者是mapi这样的编程方式.... 如果是office上的outlook应该没有问题 看看这个效果怎么做? 求c++代码覆盖率测试工具 如何在单机上建立VC的网络程序的测试环境 出售各种音频、视频的CODEC 从表中获取所有的字段问题 关于OpenGL的一个问题 发现MFC的BUG... 请问怎样限制拆分窗口后分割线的移动? Clistctrl显示数据库记录的问题,请大家帮我! 请问怎样可以可视化地选择一个路径,而不是一个文件? 关于高亮显示工具栏图标 为什么创建一个新Csocket对象就要继承一个新类呢
Variant Outlook = CreateOleObject( "Outlook.Application" );
Variant MAPINamespace = Outlook.OleFunction( "GetNamespace", "MAPI" );
Variant contactsFolder = MAPINamespace.OleFunction( "GetDefaultFolder", olFolderContacts );
Variant contactItems = contactsFolder.OlePropertyGet( "Items" );
Variant contactItemsCount = contactItems.OlePropertyGet( "Count" );
for( int i = 1; i <= contactItemsCount; i++ )
{
Variant contactItem = contactItems.OleFunction( "Item", i );
for( int j = 0; propertyList.setCurrent( j ); j++ )
{
Variant propertyValue = contactItem.OlePropertyGet( "FullName" );
}
}jingjing_123 can refer this document from MSDNIn additon to it,the following is a LISTOlePropertyGet with one of these values:Title
FirstName
MiddleName
LastName
Suffix
FullName
CompanyName
Department
JobTitle
BusinessAddressStreet
BusinessAddressCity
BusinessAddressState
BusinessAddressPostalCode
BusinessAddress
BusinessAddressCountry
HomeAddressStreet
HomeAddressCity
HomeAddressState
HomeAddressPostalCode
HomeAddress
HomeAddressCountry
OtherAddressStreet
OtherAddressCity
OtherAddressState
OtherAddressPostalCode
OtherAddress
OtherAddressCountry
AssistantTelephoneNumber
BusinessTelephoneNumber
Business2TelephoneNumber
BusinessFaxNumber
CallbackTelephoneNumber
CarTelephoneNumber
CompanyMainTelephoneNumber
HomeFaxNumber
HomeTelephoneNumber
Home2TelephoneNumber
ISDNNumber
MobileTelephoneNumber
OtherFaxNumber
OtherTelephoneNumber
PagerNumber
PrimaryTelephoneNumber
RadioTelephoneNumber
TTYTDDTelephoneNumber
TelexNumber
Account
Anniversary
AssistantName
BillingInformation
Birthday
BusinessAddressPostOfficeBox
Categories
Children
Email1Address
Email1AddressType
Email1DisplayName
Email2Address
Email2AddressType
Email2DisplayName
Email3Address
Email3AddressType
Email3DisplayName
Gender //Unspecified=0, Female=1, Male=2
GovernmentIDNumber
Hobby
HomeAddressPostOfficeBox
Initials
InternetFreeBusyAddress
Language
ManagerName
Mileage
OfficeLocation
OrganizationalIDNumber
OtherAddressPostOfficeBox
Importance //Priority: Low=0, Normal=1, High=2
Profession
ReferredBy
Sensitivity //Private: Normal=0, Personal=1, Private=2, Confidential=3
Spouse
User1
User2
User3
User4
WebPage
#import "e:\Program Files\Microsoft Office\Office\mso9.dll" named_guids
#import "e:\Program Files\Microsoft Office\Office\MSOUTL9.olb" \
no_namespace exclude("_IRecipientControl", "_DRecipientControl")这两个库文件都找不到
::CoInitialize(NULL);
{
_ApplicationPtr spOutlook("Outlook.Application");
_NameSpacePtr spNamespace = spOutlook->GetNamespace("MAPI");
MAPIFolderPtr spFolder = spNamespace->GetDefaultFolder(olFolderContacts);
_ItemsPtr spItems = spFolder->GetItems();
_ContactItemPtr spContact; char s[200]={0};
for(int i=1;i<=spItems->Count;++i)
{
spContact = spItems->Item(i);
sprintf(s, "%s%s", _com_util::ConvertBSTRToString(spContact->Subject), _com_util::ConvertBSTRToString(spContact->MobileTelephoneNumber));
//AfxMessageBox(_T(s));
}
spContact = NULL;
spItems = NULL;
spFolder = NULL;
spNamespace = NULL;
spOutlook = NULL;
}
::CoUninitialize();为什么 _ApplicationPtr spOutlook("Outlook.Application"); 运行的时候报错 :
ReadBookFromOutlook.exe 中的 0x7c812a6b 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0013f18c 处的 _com_error。
ReadBookFromOutlook.exe 中的 0x7c812a6b 处未处理的异常: Microsoft C++ 异常: 内存位置 0x0013f18c 处的 _com_error。
#import “C:/Program Files/Microsoft Office/Office11/MSOUTL.olb” rename_namespace(”Outlook”), named_guidsusing namespace Office;
using namespace Outlook;但是系统找不到MSOUTL.olb文件,我在网上下了一个,可以编译通过,但是运行,就报上面的错