如题,看过以前的贴,没有找的解决方法。

解决方案 »

  1.   

    Just a small example
    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
      

  2.   

    这个是发邮件的吗??明明是contract操作啊
      

  3.   

    o sorry,连接的网址是自动发邮件的,但是你贴出来的代码部分,但是 这个提示 “Variant”  未声明的标识符 MFC 里没有种类型的变量
      

  4.   

    Tr0j4n, VARIANT atl头文件什么意思?要加载哪个头文件,知识浅薄,请说明白一些,谢谢
      

  5.   

    我给你贴的那个MSDN文档你看下,还有有的问题你可以去Google,MSDN。不用每个问题都面面俱到地问
      

  6.   

    pContact->GetEmail1Address()是获取邮件地址,这你也看到了吧?根据1#下面的那些属性进行填充
      

  7.   

    我的是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")这两个库文件都找不到
      

  8.   

    google vc outlook.applicationhttp://topic.csdn.net/t/20050620/20/4095077.html
      

  9.   


     ::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。
      

  10.   

    你引用dll了么??还有outlook应该在你机器有装
      

  11.   

    引用了,在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文件,我在网上下了一个,可以编译通过,但是运行,就报上面的错
      

  12.   

    oe6似乎不支持vba 你看看http://blog.sina.com.cn/s/blog_4c62562801000bhw.html或者是mapi这样的编程方式....
      

  13.   

    如果是office上的outlook应该没有问题