Apache OpenOffice (AOO) Bugzilla – Issue 9160
Some AddressBook Outlook fields not displayed
Last modified: 2008-05-16 03:30:20 UTC
There are two data integration problems between OOo and Outlook: 1. Outlook is capable of running in Outlook Internet Local (OIL) and Outlook Corporate/Workgroup Local (OCL) modes. When Outlook is configuerd in Corporate/Workgroup mode, then some data does not appear in OOo. The following fields do not display any data: a. Nickname b. Home web page c. Work web page d. Birth Year, Birth Month, Birth Day (all set to 0) e. Comments 2. Additional Email does not work in either mode. I checked the Mozilla import feature and it successfully imports nickname, additional email, and home web page in OCL mode.
Sean, can you please have a loot at this?
Marc, can you confirm this issue (I do not have an Outlook at hand here)?
mass re-assign of address book integration issues
re-assign to wind
Yes,We lost the fields.
>I checked the Mozilla import feature and it successfully imports >nickname,additional email, and home web page in OCL mode. I checked the Mozilla code and I find we use outlook addrbook in a different way from Mozilla import.In mapi there are two way to get address datas.The IMsgStore interface provides access to message store information and to messages and folders include address.The IAddrBook interface supports access to the MAPI address book.Mozilla import feature use IMsgStore interface and oo use other code in Mozilla they use IAddrBook interface to access address book.It nearly worked.But maybe this is a bug of microsoft,it does not support nickname,additional email, home web page,birthday and maybe other fields in OCL mode.I have write a sample to test IAddrBook.I will upload it late.
Created attachment 8620 [details] Sample to check what is support by IAddrBook
about attachment (id=8620) The code using the same way as oo to get address books from outlook . Build addr.Open outlook,Run addr with no args.You can see nearly all field are not supported by IAddrBook. Run addr with arg "printall",You can see some fields are "not supported" but can get values such as fistname,but get nickname will cause an error. I think this is a bug of outlook.So I think we have to move from IAddrBook to IMsgStore.If who is familiar with MAPI,please give me advice.
Created attachment 8623 [details] Access outlook address book through IMsgStore
Created attachment 8647 [details] updated,can get email address now
Difference of three kinds of method to access outlook address book: 1.IAddrBook : very slow, can't access nickname and more other fields, Currently used by oo and see http://abzilla.mozdev.org/ "Enabling Outlook and Outlook Express through the Preferences File ". 2.IMsgStore : very slow, can't access distributions, Currently used by mozilla import feature. Easy to transfer to. 3.Use Microsoft Outlook Object Libary very quick, Not implemented using tables,can't use Outlook MAPI Propery name(see http://dba.openoffice.org/FAQ/Outlook_field_mapping.html) to query field value, harder to transfer than 2. The 3ed method look like this: Option Compare Database Sub ImportContactsFromOutlook() ' This code is based in Microsoft Access. ' Set up DAO objects (uses existing "tblContacts" table) Dim rst As DAO.Recordset Set rst = CurrentDb.OpenRecordset("tblContacts") ' Set up Outlook objects. Dim ol As New Outlook.Application Dim olns As Outlook.Namespace Dim cf, cfs As Outlook.MAPIFolder Dim c As Outlook.ContactItem Dim d As Outlook.DistListItem Dim r As Recipient Dim objItems As Outlook.Items Dim Prop As Outlook.UserProperty Dim iNumContacts As Integer Dim i As Long Set olns = ol.GetNamespace("MAPI") For Each cfs In olns.Folders For Each cf In cfs.Folders ' Set cf = olns.GetDefaultFolder(olFolderContacts) If cf.DefaultItemType = olContactItem Then Set objItems = cf.Items iNumContacts = objItems.Count If iNumContacts <> 0 Then For i = 1 To iNumContacts If TypeName(objItems(i)) = "ContactItem" Then Set c = objItems(i) rst.AddNew rst!FirstName = c.FirstName rst!LastName = c.LastName rst!Address = c.BusinessAddressStreet rst!City = c.BusinessAddressCity rst!State = c.BusinessAddressState rst!Zip_Code = c.BusinessAddressPostalCode ' Custom Outlook properties would look like this: ' rst!AccessFieldName = c.UserProperties("OutlookPropertyName") rst.Update ElseIf TypeName(objItems(i)) = "DistListItem" Then Set d = objItems(i) Dim j As Long For j = 1 To d.MemberCount Set r = d.GetMember(j) rst.AddNew rst!FirstName = r.Name rst!Address = r.Address rst.Update Next End If Next i rst.Close End If End If Next Next MsgBox "Finished." End Sub To save time I use vb for this example,can transfer to c++ if needed.
Created attachment 8774 [details] Microsoft Access mdb file,see modules/ImportOutlook/ImportContactsFromOutlook for detail
Wind, to me this sounds as if 3. would be the most work to implement, but perhaps also the safest. If I understand you right, you suggest that 1. is bad because the implementation from MS may be buggy. About 2.: What does > can't access distributions, mean? What would we actually *lose* when we move to 2.?
forgot to add: I am not really eager to invest too much effort into 3., if we can get nearly the same, with no or less loss of functionality, with 2.
We currently use 1st method.But we miss some fields and we can't really import outlook mailing list,but the method itself support mailing list. If we use 2ed method,we get back the missing fields,but it does not support mailing list(nameed "Distribution" by outlook). If we use 3st method,users must have outlook installed in his machine.And maybe the bigest issue is that when useed with OfficeXp,every time we access address outlook will popup a window to ask if an access to address is allowed.I think it is used to prevent viruses from sending junks. So it is hard to decide.
The window popping up with the 3rd method disqualifies it - this is not acceptable. The missing mailing lists may not be a problem for OOo, but for Mozilla. In OOo, we "flatten" the address data, and we cannot display mailing lists in OOo, anyway. But for Mozilla, for the life access to an Outlook AB from within Mozilla, the missing support for mailing lists may be a problem. Does this mean that the import, since it uses 2., does *not* import mailing lists, too?
>Does this mean that the import, since it uses 2., does *not* import mailing lists, too? No,it does *not*.At less my Mozilla does not reealy import mailing lists.It only import the name of mailing lists,and make a empty mailing list in mozilla address. >and we cannot display mailing lists in OOo It is not a problem,we can convert it to a folder.
>> and we cannot display mailing lists in OOo > It is not a problem,we can convert it to a folder. Hmm? What kind of folder? I mean, when we access the Outlook addresses as database-like table with our SDBC driver, then we only have the concept of "one row = one address". I don't see how we can map mailing lists in this concept?
>What kind of folder? I mean we can treat it as a folder( a sdbc table),such as "OP Contacts",etc.We may lose the mailing list *itself*.But will get back the mailing lists in it.
ah! Interesting idea, this would would indeed be nice ... Anyway, for the original problem we have here: As I see it, we can either have all fields, but no mailing lists, *or* we can have mailing lists, but not all fields. So which one is worse? :( Is there a chance to deteremine why accessing the mailing list via 2. fails? Perhaps something needs to be done differently that the current import in Mozilla does?
>Is there a chance to deteremine why accessing the mailing list via 2.fails? Microsoft does not give us an interface to access mailing list.Maybe Microsoft give one but I cann't find it.
I take back what I had said.I just find a way to access mailing list using IMsgStore.It use IMailUser,a none documented name id 0x8054.Now there is no problem.I plan to : 1.Add mailing list to mozilla import. 2.Rewrite nsMapiAddressBook using MAPI IMsgStore. 3.Modify connectivety/mozab driver to make it treat outlook mailing list as a table.I think this will effect on all mozilla mailing list,so I suggest weather we need file a new issuse on it?
Created attachment 9078 [details] outlook sample with mailing list supported
Wind, this is *great*! I agree to creating a separate issue for the third item (mapping mailing lists to tables), just to keep things clearly separated. I also suggest filing an issue for 1. in BugZilla, and make the changes independent on 2., so you can submit/commit them to Mozilla independently.
There already have many bugs about mailing list problem in Bugzilla.mozilla.com. This is one: http://bugzilla.mozilla.org/show_bug.cgi?id=149961.
okay, this one fits perfectly :), thanks
Created attachment 9296 [details] A patch to mozilla 1.5b to make it support outlook mailing list
Created attachment 9393 [details] A patch to mozilla 1.0 to make it import outlook mailing list
Created attachment 9444 [details] a patch for mozilla 1.5b to make it use IMsgStore to access outlook addressbook
mozilla need another patch. When get birthday,we must convert UTC time to local time. FILETIME localTime ; FileTimeToLocalFileTime(&values->Value.ft,&localTime);
Created attachment 10735 [details] Patch to get back the lose fields and support query "criterion"
This patch is base on our big patch.You need apply our big patch before apply this patch. See http://bugzilla.mozilla.org/show_bug.cgi?id=219559 for detail. Effect: 1.You can nearly access all contact folder in outlook.(see bellow) 2.Better perfomance. 3.Get back the lost fields. 4.criterion query on both OP and OE. Know issue: If you have two folders with the same name in your outlook,you can only access the first folder.
Created attachment 10736 [details] Workable binary for last patch.Tested by m645.
Created attachment 10793 [details] Mapping mail list as a table
file a new issue for the last patch. http://www.openoffice.org/issues/show_bug.cgi?id=21912
change subcomponent to 'none'
Migrate to a new account for security reasons.
fixed in cws mozab03
verified in mozab03 wnt build
verify in CWS mozab03
This Issue is 'Verified' and not updated in 1yr+, so Closing. A Closed Issue is a Happy Issue (TM). Regards, Andrew Cleaning-up and Closing old Issues as part of: ~ The Grand Bug Squash, pre v3 ~