![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Outlook 2007 will only import the first item in a multiple-item VCF file.
This is hugely annoying to businessmen (and women). I have a tested the following working solution. First, run the following C# program against the VCF file to split the items into multiple files. Next, run the following skeleton to produce a VBScript file. Then, open the command prompt and Outlook 2007. With nothing else going on in your computer (like AIM or something else that might disrupt your screen environment), run the VBScript from the command prompt using wscript. DO NOT TOUCH THE KEYBOARD OR MOUSE! This will insert in all completeness the data in the VCF. You will find them in your Contacts. Outlook 2007 permits you to create a PST file of the Contacts. The C# program: using System; using System.Collections.Generic; using System.Text; using System.IO; namespace VCARD_SPLITTER { class Program { /* BEGIN:VCARD VERSION:2.1 N:xxxxx;xxxxx TEL;CELL:0000000000 END:VCARD BEGIN:VCARD VERSION:2.1 N:ccccc;cccc TEL;WORK:2020000000 END:VCARD */ static void Main(string[] args) { ListCONTACT ListOfContacts = new ListCONTACT(); int linecount = 0; int contactNumber = 0; CONTACT cntct = null; using (StreamReader sr = new StreamReader(@"C:\Users\Ugen\Documents\Whole Phonebook.vcf")) { for (; ; ) { string line = sr.ReadLine(); if (line == null) break; linecount++; if (line.Equals("END:VCARD")) { if (cntct != null) { cntct.Add(line); contactNumber++; string newfilename = @"C:\Users\Ugen\Documents\manyContacts\" + contactNumber.ToString() + ".VCF"; using (StreamWriter sw = new StreamWriter(newfilename)) { int numberOfLines = cntct.GetLength(); int i; for (i = 0; i numberOfLines; i++) sw.WriteLine(cntct.GetString(i)); cntct = null; } } } else if (line.Equals("BEGIN:VCARD")) { cntct = new CONTACT(); cntct.Add(line); } else cntct.Add(line); } } Console.WriteLine("Done. " + linecount.ToString() + " lines."); } } } The SSG skeleton: Dim oShell Set oShell = CreateObject("Wscript.Shell") oShell.AppActivate "Outlook" *INCREMENT Z TO 430 oShell.AppActivate "Outlook" Wscript.Sleep(1000) oShell.SendKeys "%F" *INCREMENT X TO 5 Wscript.Sleep(2000) oShell.SendKeys "{DOWN}" *LOOP Wscript.Sleep(1000) oShell.SendKeys "{ENTER}" Wscript.Sleep(1000) *INCREMENT Y TO 2 oShell.SendKeys "{HOME}" Wscript.Sleep(1000) *LOOP *INCREMENT Y TO 2 oShell.SendKeys "{DOWN}" Wscript.Sleep(1000) *LOOP oShell.SendKeys "{ENTER}" Wscript.Sleep(1000) oShell.SendKeys "C:\Users\Ugen\Documents\manyContacts\[*Z].VCF" Wscript.Sleep(2000) oShell.SendKeys "{ENTER}" Wscript.Sleep(5000) *LOOP -- William McIlroy ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/comm...tlook.contacts |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Opening *.PST file: "Can't open this item. Outlook blocked access to this potentially unsafe item." | R2D2 | Outlook - General Queries | 1 | September 16th 07 08:14 AM |
Outlook 2007 and Item.Close | slbergh | Outlook - Using Forms | 2 | June 8th 07 06:11 AM |
SharePoint (WSS) 2007 / Outlook 2007 - Alert - Cannot open this item | Harry Pfleger | Outlook - General Queries | 2 | January 2nd 07 11:15 PM |
Item.Save and Item.Close Script causes Outlook 2007 to Crash | Rayyan | Outlook - Using Forms | 6 | November 25th 06 03:14 AM |
Lame Question and maybe not so lame question | daslf | Outlook - General Queries | 2 | May 9th 06 05:04 AM |