How to migrate NK2 Auto complete cache “suggested contacts” from Microsoft Outlook 2003 or 2007 to Microsoft Outlook 2010

2010 May 21st | By Leo Pasut | Comments (14) | Permalink

Under: Auto Complete - C++ - examples - Microsoft - Microsoft Exchange - Migration - NK2 - Office 2003 - Office 2007 - Office 2010 - opensource - opinion - Outlook 2003 - Outlook 2007 - Outlook 2010 - products - programming - releases - services - suggested contacts - thunderbird - Windows Live

How to migrate NK2 Recipient AutoComplete cache lists “suggested contacts” from Microsoft Outlook 2003 or 2007 to Microsoft Outlook 2010

Note You must exit Outlook 2003, 2007, 2010 before starting the following procedure. The names will be included in AutoComplete when you restart Outlook.

1. On the computer (Office 2003 or 2007) with the saved AutoComplete names, go to “drive: \Documents and Settings\user name\Application Data\Microsoft\Outlook”.
Note Depending on your operating system (Windows 7, Windows Vista, Windows XP, and Windows 2000) or the folder options, the folder might be hidden. To view the files in this folder, do one of the following:
Windows 7
1. Click Start, and then click My Computer.
2. On the Tools menu, click Folder Options.
3. Click the View tab, and then, under Advanced settings, under Hidden files and folders, click Show hidden files and folders.
4. Uncheck hide extensions for known file types.
Windows Vista
5. Click Start, and then click My Computer.
6. On the Tools menu, click Folder Options.
7. Click the View tab, and then, under Advanced settings, under Hidden files and folders, click Show hidden files and folders.
8. Uncheck hide extensions for known file types.
Microsoft Windows XP
9. Click Start, and then click My Computer.
10. On the Tools menu, click Folder Options.
11. Click the View tab, and then, under Advanced settings, under Hidden files and folders, click Show hidden files and folders.
Microsoft Windows 2000
12. Double-click My Computer on your desktop.
13. On the Tools menu, click Folder Options.
14. Click the View tab, and then click Show hidden files and folders.
2. Right-click profile name.nk2, and then click Copy.
Tip You can copy the file to removable media, such as a USB key (Pen drive) or a CD (DVD), and then copy the file to the correct location on the other computer. Or you can attach the file to an e-mail message and send the message to yourself. On the new computer, open the attachment, and then save it to the correct location.
Note You must exit Outlook before starting the following procedure. The names will be included in AutoComplete when you restart Outlook.
3. On the Office 2010 where you want to migrate the AutoComplete feature too, Paste the NK2 file to drive:\%user name%\%appdata%\Microsoft\Outlook
4. If prompted about replacing the existing file, click “yes”.

1. Note that the .nk2 file must have the same name as your current Outlook 2010 profile. By default, the profile name is “Outlook.” To check the profile name, follow these steps:

2. Click Start, and then click Control Panel.
3. Double-click Mail.
4. In the Mail Setup dialog box, click Show Profiles.
5. Click Start, and then click Run.
6. In the Open box, type outlook.exe /importnk2, and then click OK. This will import the .nk2 file into the Outlook 2010 profile.

Nektra Advanced Computing is developing a tool that will auto create an .NK2 file from Outlook Express (using OEAPI), Windows Mail (using OEAPI), Windows Live Mail (Using WLMAPI), an the export to Outlook 2003, Outlook 2007 & Outlook 2010. We also offer a solution service from any legacy environment/platform to any new environment/platform. For information about pricing or demos please call 1-(310)237-6506.

Outlook Plugin Development

We have a team of experts developing plugins for Outlook. We have a wide experience using Outlook API and we are able to go beyond Outlook API when you need something that cannot be developed using the startdard API.
Our team works in US time, that’s what makes Nektra the best decision for US companies.
Our sales team can be contacted any time in our office in Callifornia (310) 237-6506.
For more information visit Outlook plugin development

Migration and Reverse Engineer Services

Nektra has a wide experience building ad-hoc migrations for applications that doesn’t provide importing and exporting mechanism. We have researched a large number of applications looking for undocumented interfaces to use for this purpose. A prove of these skills are our products and a big amount of articles researching different technologies.
We have a team of professionals that can help so Just ask.

Top Areas:

Complete list of Nektra High Tech Services

Export messages and folders from Thunderbird to Outlook / Outlook Express / Windows Mail

2009 April 14th | By Pablo Yabo | Comments (108) | Permalink

Under: Microsoft - Microsoft Exchange - Migration - OEAPI - Office 2003 - Office 2007 - Office 2010 - Outlook 2003 - Outlook 2007 - Outlook 2010 - products - programming - services - thunderbird

I was tired of some problems I experienced with the Thunderbird database and the lack of support of Windows Desktop Search.  So I decided to migrate from Thunderbird to Outlook.

I found several tutorials explaining how to do it using the free tool IMAPSize.

The problem with this procedure is that email conversion using this tool requires you to manually select each Thunderbird directory that contains the messages of each folder. It is fine for a few directories but a very long task if you have more than a hundred.

In addition to this issue, I found some export problems using the tool: it works with most of the messages but there are some problems with certain messages that are created with a wrong structure or with problems in the header (e.g.: empty subject and wrong received timestamp) when importing into Outlook Express / Windows Mail.

Looking for another method, I found a free tool Tbird2OE from PractiSoft. It is rudimentary but it does the first job: it exports all the messages to eml format keeping folder structure and no errors.

To import messages into Outlook Express / Windows Mail, the tutorial suggests to drag them in each exported folder. Again, this is simple for small amount of folders but it could take considerable amount of time if you have lots of folders.

For that reason I wrote a tool to import the exported messages using our product OEAPI to store messages in Outlook Express / Windows Mail.

Here is the step-by-step tutorial:

  1. Compact messages (recommended but optional)
  2. Make sure you have lots of disk space free to store the messages (from Chuck).
  3. Use Tbird2OE to export messages from your Thunderbird profile:
    • Top edit box your mail root in the top edit box, usually something like this: C:\Documents and Settings\UserName\Application Data\Thunderbird\Profiles\awfiwoeu.default\Mail\Local Folders
    • Bottom edit box: any path where the emails will be stored in eml format keeping folder structure
  4. Install OEImportEml:
    • Set the same directory that you specified in Tbird2OE as export path (the bottom edit box)
    • Set Thunderbird ‘Sent’ folder if your installation is not English (the folder specified here is forwarded to ‘Sent Items’ in Outlook Express / Windows Mail)
  5. If you want to use Outlook, run Outlook and select to import messages from Outlook Express / Windows Mail

Windows 7

User Edgar reported that the process works using Outlook 2007 and Windows Live Mail but no account set up.

Another option reported by Johnny Y.: To Migrate messages from an XP to Windows 7 PC, use Outlook on the original XP PC to import from Outlook Express. Then Export to a PST and transfer PST files to the new Windows 7 PC and import, since Windows 7 does not come with Outlook Express.

Outlook Plugin Development

We have a team of experts developing plugins for Outlook. We have a wide experience using Outlook API and we are able to go beyond Outlook API when you need something that cannot be developed using the startdard API.
Our team works in US time, that’s what makes Nektra the best decision for US companies.
Our sales team can be contacted any time in our office in Callifornia (310) 237-6506.
For more information visit Outlook plugin development

Migration and Reverse Engineer Services

Nektra has a wide experience building ad-hoc migrations for applications that doesn’t provide importing and exporting mechanism. We have researched a large number of applications looking for undocumented interfaces to use for this purpose. A prove of these skills are our products and a big amount of articles researching different technologies.
We have a team of professionals that can help so Just ask.

Top Areas:

Complete list of Nektra High Tech Services

Monitoring Outlook COM Objects with Deviare

2008 December 1st | By Pablo Yabo | Comments (0) | Permalink

Under: .NET - C# - C++ - Deviare - Microsoft - Office 2003 - Office 2007 - Office 2010 - Outlook 2003 - Outlook 2007 - Outlook 2010 - programming - reverse engineer - services

We all remember when Ole Automation came out. We were all impressed how simple it was to implement a few COM Interfaces, place a toolbar and interact with the office package. Soon the competition began to show who could create the best and most creative Add-on. How many times did you wonder how that other plug-ins “did that”? What if now you can even know how Outlook, or any Office application operates? Well, my friend, take a closer a look…

This Deviare example is implemented as an Outlook Add-on. We have used C# .Net, but you can use any language that supports Component Object Model.

We are using 2 threads to avoid freezing the application. The first one is the standard thread where Outlook report its events to us. The second is our worker thread where we create an output window to print our messages and a Deviare Event Proxy to process functions’ calls.

sc1

From the events Outlook provides us to work with we are only interested in OnStartupComplete. Here we know that Outlook is done with all its initialization and we can start hooking its interfaces. As a regular plug-in we ask for the Outlook Application, Active Explorer, CommandBars and create a CommandBarButton. We are going to intercept all of them and see how their members are used.

sc2

Notice that to obtain the interface we don’t use the class implementation, but the underlying interface definition. That’s why, when calling HookInterface, we send the Type of Outlook._Application and not Outlook.Application. The second one, is the .Net wrapper, and the first one is the Ole Interface.

To intercept these objects, Deviare needs some information. The necessary elements are the COM Object Interface (that would be its virtual table), which members we are interested in (specified by index), and the name of the Interface. Identifying the interface by name, will let Deviare find all the information it needs during the call, so you can handle its parameters the same way we did with any function hook. To gather all this the .Net Framework provides us with marshaling facilities (System.Runtime.InteropServices.Marshal), this makes our lives pretty easy ;) .

sc3

And that’s all. We print our calls, and see our results:

sc4

Cheers, and happy coding!

How to customize the WebBrowser context menu in C#

2008 April 24th | By Pablo Yabo | Comments (9) | Permalink

Under: .NET - C# - Microsoft - Office 2003 - Office 2007 - Office 2010 - Outlook 2003 - Outlook 2007 - Outlook 2010 - programming

It is hard to find on the internet a detailed and complete solution for modifying the contextual menu due to several reasons.

One of these reasons is that many of the implementations found use the System.Windows.Forms.ContextMenu; you can see one of them here:

Component-Based Development with Visual C#

In these kinds of examples the system menu is not invoked from the ShowContextMenu, instead a user customized menu is. This menu does not allow modifying it as we need.

Another reason is due to the programming language. In the MSDN website a C++ implementation of the ShowContextMenu can be found:

WebBrowser Customization (Part 2)

The problem is that when we want to implement it in C# difficulties such as not being able to call system functions, use the same data types, and many others arise.

Maybe the biggest difficulty can be found when trying to marshall the CComVariant class. A huge variety of solutions can be found on the internet, but they usually do not work (at least in the case mentioned above). Here are some examples of them:

VB Variant Equivalent in C#

Object To Variant

What is the equivalent of Variant data type in C#.NET?

Using the int[] type with size 3 or bigger is one of the ways of solving this.

   1:  int[] variantVar = new int[3];

The VARIANT type can be seen in this MSDN webpage:

VARIANT and VARIANTARG

Once we solved this problem, we can use the IOleCommandTarget function Exec:

   1:  [PreserveSig]
   2:  int Exec(
   3:      ref Guid pguidCmdGroup,
   4:      int nCmdID,
   5:      int nCmdExecOpt,
   6:      // we need to have this an array because callers 
   7:      // need to be able to specify NULL or VT_NULL
   8:      [In, MarshalAs(UnmanagedType.LPArray)] int[] pvaIn,
   9:      [Out, MarshalAs(UnmanagedType.LPArray)] int[] pvaOut
  10:      );

When calling Exec for the first time, we get the handle for the language submenu. We obtain it in variantVar variable:

   1:  int[] nullVariantVar = null;
   2:  int[] variantVar = new int[3];
   3:   
   4:  spCT.Exec(
   5:              ref CGID_ShellDocView,
   6:              SHDVID_GETMIMECSETMENU,
   7:              0,
   8:              nullVariantVar,
   9:              variantVar
  10:              );

Now we must parse variantVar in order to get the result (the handle for the language submenu). The first value that we get is a VARTYPE type, which indicates the kind of variable that we will find next. Then there is a reserved spot of three WORD long, followed by the value we are looking for. So the handle for the submenu is on the second place of the array:

   1:  IntPtr handleSubMenu = new IntPtr(variantVar[2]);

We can replace passing the CComVariant argument to the function by creating a new variable shown in the code below and then call again Exec:

   1:  variantVarIn[0] = VT_INT_PTR;
   2:  // Remember that variantVarIn[1] is reserved
   3:  variantVarIn[2] = handleMenu.ToInt32();
   4:   
   5:  variantVarOut[0] = VT_I4;
   6:  // Remember that variantVarOut[1] is reserved
   7:  variantVarOut[2] = dwID;
   8:   
   9:  // Insert Shortcut Menu Extensions from registry.
  10:  spCT.Exec(
  11:              ref CGID_ShellDocView,
  12:              SHDVID_ADDMENUEXTENSIONS,
  13:              0,
  14:              variantVarIn,
  15:              variantVarOut
  16:              );

We obtain the complete context menu as a result of the instructions shown above. This menu can be modified as much as we desire. Using this, you can add or remove menu items and also their functionality. For example you can call methods implemented in your project from the desired menu item.

Now you can build a customized browser using C# !

Custom Outlook Development

We have a team of experts developing plug-ins for Outlook. We can go beyond Outlook API and develop modifications to those functions that lacks of some features that your product may need. Our team leaders are experts running projects and our customers can feel confident that their product will be released in time. Our sales team can be contacted any time in our office in California  (310) 237-6506.
For more information visit Outlook plugin development