Jump to content
AVIC411.com

outlook contacts to phonebook


Recommended Posts

All,

 

love this forum, so I decided to do something back.

 

I own a HTC Touch, with a problem for the phonebook: it does not recognize the number properties (mobile, home, work, ...). I know it is possible to copy the Phonebook db from the Avic, edit it via SQLite (love the FireFox extension, btw) and then back to the Avic. But that is tedious. So I wrote a small Outlook macro to do this for me: it loops through all my outlook contacts (synced with Touch), and writes a SQL script. Optionally it also executes this script and writes the actual DB file in one go.

 

How does it work: for every contact, it looks for 3 phonenumbers: mobile, work and home. If it only finds one, it writes the record with dwType 0 (default), otherwise it sets the appropriate type. The output is sorted by FullName (works for me). Another gizmo is you can also assign a category (I chose "dont-export") for the contacts you do not want to show up in the phonebook.

 

Attached is the Class file, ready to be loaded into outlook. The macro writes into the temp folder (c:\temp), but that is cutomizable. For sqlite to write the DB, it is best to also put sqlite3.exe in the temp folder.

 

Of course, the file written does not contain your specific BlueTooth ID, so you will either have to rename it, or customize the target filename in the macro

 

have fun

 

weo

Link to post
Share on other sites
  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

Thanks avic-weo for the macro post. I tried to load it into outlook via M Visual Basic (File... Import File...), but it does not seem to recognise the code. :shock: The code loads up in ThisOutlookSession, but cannot be compiled. I use XP and Outlook 2003 and VB 6.5. Any advice on how to load up the macro?

Link to post
Share on other sites
...How does it work: for every contact, it looks for 3 phonenumbers: mobile, work and home. If it only finds one, it writes the record with dwType 0 (default), otherwise it sets the appropriate type. The output is sorted by FullName (works for me)...

 

How did you find out/know the dwType? I scratched my head but didn't got it.

Link to post
Share on other sites
Thanks avic-weo for the macro post. I tried to load it into outlook via M Visual Basic (File... Import File...), but it does not seem to recognise the code. :shock: The code loads up in ThisOutlookSession, but cannot be compiled. I use XP and Outlook 2003 and VB 6.5. Any advice on how to load up the macro?

 

Hi MustangAvic, glad to see somebody is interested in this code.

 

I developed this using Outlook2007 and Vista, but there should be no reason why this does not work under XP/OL2003. A quick check on such a machine did reveal a quirk: importing the file creates another module, which then can not be "executed". :shock:

 

OL2007 also defined a generic Folder type, which in OL2003 needs to be replaced by MAPIFolder

 

So I suggest the following:


  • [*:2pzctsjy]start Outlook
    [*:2pzctsjy]open VBA editor by hitting Alt-F11
    [*:2pzctsjy]copy/paste the code from the cls file in the module ThisOutlookSession from Option Explicit onwards
    [*:2pzctsjy]return to Outlook (you can close the VBA editor)
    [*:2pzctsjy]run the macro via Tools->Macro, or by hitting Alt-F8

 

Afterwards, when you copy the generated file in the MiTACAP folder at the appropriate location, it gets copied automagically. Actually, this whole process is faster than uploading my contacts from my phone to the AVIC.

 

I have also updated the txt file with the above

 

have fun

 

Weo

Link to post
Share on other sites

After reading

http://www.avic411.com/forum/viewtopic.php?f=32&t=25921

i thought if the idea could be solved here.

Question:

Is it possible to export the adresses of contacts as POIs? Does it make sense in the AVIC?

 

I really wish we would have access to the source code of this phone application to improve it! They use a SQL database to store a name and a phone number as normal text and nothing more. There is much more potential in it like showing contact pictures instead of icons or set a contact as destination for navigation. Hellooo Pioneer!

Link to post
Share on other sites
  • 2 weeks later...

Weo,

thank's so much for this perfectly working workaround!

The import of the contacts on my Nokia N71 didn't work well (first name/last name got in wrong direction) - and I was spending DAYS in trying different configurations without success.

 

With your macro it just took me 10 minutes to execute & replace the db-file on the unit - and now everything is the way I ever wanted it - I can distinguish between home, office and mobile - and everything is ordered as it should be (lastname, first name).

 

Thank you so much!

 

Bye,

Boby

Link to post
Share on other sites
  • 2 weeks later...

Hey everyone.

 

I am pretty much a newbie with this stuff, but have gotten everything to work to the point of now I have a file in my c:\temp folder "contacts.sql"

 

What do I need to do to get this file correctly on the AVIC? Is there anything else I need to do other than just place this file somewhere on the unit's HD?

 

Thank you very much, this is such a great forum.

 

Justin

Link to post
Share on other sites

The macro creates two files:

- One file containing the SQL code which is being executed afterwards and (=you don't need it for your device!)

- one file containing the data you need to copy to your unit (that's what you need to copy).

 

How to?

 

The easiest way:

1) Look at your unit, what's the Bluetooth-ID of your cell phone. You can find it out by looking into the folder "\My Flash Disk\USER\UserData\PHONEDATA". There you'll find a file called like "PhoneBookxxxxxxxxxx.db", where the x here stand for diffrent numbers and letters. That's the name the created file with the data has to have when you copy it there (otherwise your unit won't find it). It's important, that you've allready registred your cell phone initially on the unit (otherwise the directory will stay empty).

2) Open the Outlook macro and change the following line:

Const SQDB As String = "C:\temp\contacts.sqdb"

to: Const SQDB As String = "C:\temp\PhoneBookxxxxxxxxxx.db" (according to the name you discovered in step 1)

3) Start the macro

4) Copy the created .db-file from C:\temp to a SD card, boot your device in testmode and copy the file to the PHONEDATA directory, overwriting the exising file on your unit.

 

Regards,

Boby

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...