使用的是Windows Mobile 的手機。 2B的Windows同步軟件缺省會用PC上的覆蓋手機上的內容,即便PC上一條記錄也沒有,也會把手機上面的記錄所有清空。html
並且發現不一樣手機操做系統的手機通信錄沒法自動轉換。--- 就TMD的姓名,手機號兩個字段。就不能建立一個統一的格式?python
惟一統一的格式vCard. 2B 的Office只能導入一條記錄,哪怕一個vCard文件裏面有再多的記錄。在經歷噁心加憤怒(fengnu,不是fengnong, 怒字上奴下心)。程序員
幸好我們是程序員,本身動手豐衣足食。spa
用熟悉的Python和不熟悉的Office COM 接口:操作系統
NewContact.FullName = 'NewContact'component
NewContact. MobileTelephoneNumber = '13871609999'NewContact.Save()orm
這個代碼夠簡單,可是若是成功運行須要以下操做:htm
First, download and install Python (http://www.python.org/). I recommend Python 2.7. It's been around longer then Python 3, has more support, and I know it works.blog
Second, you need to download and install the Python Extension for Windows (http://sourceforge.net/projects/pywin32/). Make sure you download the version that matches your version of Python.
Third, you need to run makepy.py. I normally just do a search in my Python directory for the file. Running it will bring up a window with a selection box. Choose "Microsoft Excel 14.0 Object Library" or "Microsoft Office 14.0 Object Library". Either one seems to work for me. The version number may be different depending on the version of Microsoft Office you are using.
Now you're ready to go. The next article will give an example of a basic Python Excel script.
前兩步安裝ActivePython就OK ,重要的是第三部,我查找發現makepy.py在個人C:\Python27\Lib\site-packages\win32com\client目錄。
若是須要添加其餘字段參考:
http://msdn.microsoft.com/en-us/library/ff868407.aspx
參考資料:
http://www.cnblogs.com/myamanda/articles/1744631.html
http://www.the-generalist.com/component/content/article/46.html