Outlook Autocomplete/NK2 Locations
Outlook 2003, 2007 with Windows 2000, XP, or Server 2003
C:\Documents and Settings\[User Profile]\Application Data\Microsoft\Outlook\filename.NK2
Outlook 2003, 2007 with Windows Vista, 7, or Server 2008
C:\Users\[User Profile]\AppData\Roaming\Microsoft\Outlook\filename.NK2
Outlook 2010, 2013 with Windows Vista, 7, or Server 2008
C:\Users\[User Profile]\AppData\Local\Microsoft\Outlook\RoamCache\Stream_Autocomplete_[key].dat
Outlook 2010, 2013 with Windows XP
C:\Documents and Settings\[User Profile]\Local Settings\Application Data\Microsoft\Outlook\RoamCacheStream_Autocomplete_[key].dat
When you use the NK2Edit utility, you don’t have to worry about locating the NK2 file, it automatically opens the default file for you.
Deploy Word Macros From a Central Location
Word macros always reside in document templates. To share a macro with other users, you have to distribute the template that contains the macro. You can distribute a template in a couple of ways, including:
Send the template to others by using e-mail Each user can then save the template in the correct folder. Typically, the “correct” folder is the \Startup folder, which contains the files that Word opens automatically on startup. Steps later in this column explain how to locate your \Startup folder. This column assumes that you know how to attach a file to an e-mail message to distribute it.
Place your macros in a template and save that template on a network server You can then configure each user’s instance of Word to use the template globally. The steps in this column explain how to create a new template, save it to a network location, add macros to that template, and then configure Word to use the template globally. When you take those steps, your macros can work seamlessly with the templates that you apply to your documents.
No matter how you choose to distribute your templates, you should set a high level of macro security. Keep this fact in mind: By default, Word runs unsigned (and therefore potentially unsafe) macros that reside in your \Startup folder, regardless of the folder’s location.
Create and distribute a template
Before you go any farther, decide how you want to distribute your template. If you want to save the template in a network location, you need to create that location now. You may also want to establish access permissions that protect the template and its macros from unauthorized changes.
To create a template
- Start Word and open a new, blank document.
- On the File menu, click Save As.
- In the File name box, type a name for the template. Make the name intuitive. For this exercise, name the file global_macros.
- From the Save as type list, select Document template (.dot). At this point, you can do one of the following:
- Save the template locally and send it to others as an attachment in e-mail.
- Save the template to your network location. To do so, follow these steps:
- On the Save in list, navigate to your network location.
- Click Save and then close the template. When asked whether you want to save your changes, click Yes.
Add macros to a template
Word provides two ways to add macros to a template. You can add them directly, or you can import existing macros from other documents or templates. The steps in the following sections explain how to do either one. Again, you must make sure that you use macros at a high level of security.
If you have experience with writing macros in Microsoft Visual Basic?, you can create a new macro and add it to your template.
To add a new macro to the template
- Open global_macros.dot.
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- In the Project window, under Template Project (Global_Macros), double-click ThisDocument.
- Write your new macro. If you want to use an easy example instead of writing a new macro, copy and paste this block of code into the code window
Sub Global_Macro_Test()
MsgBox "This is a global macro test."
End Sub
- Save the macro.
- Quit the Visual Basic Editor.
When you share existing macros among templates and documents, you do so by exporting them from a source file and then importing them into a destination file. You can use these steps whenever you need to share existing macros with your coworkers.
To add an existing macro to the template
- Open the document or template containing the macro that you want to export.
- On the Tools menu, point to Macro, and then click Macros.
- Select the macro that you want to export, and then click Edit. The Visual Basic Editor starts and opens the code module for the macro.
- On the File menu in the Visual Basic Editor, click Export File. The Export File dialog box appears.
- In the Save in list, locate the folder that contains global_macros.dot, and then click Save to save the code module in that location. If it helps, you can give the module an easy-to-remember name.
- Open global_macros.dot, press ALT+F11 to start the Visual Basic Editor there, and then, on the File menu, click Import File.
- Navigate to the folder that contains global_macros.dot, click the module that you just exported, and then click Open.
- Save the module, quit the Visual Basic Editor, and then quit Word.
Configure Word to use the template globally
You follow a two-phase process to configure Word to use your template globally. First, you change the path to the location of the files that Word loads on startup. Second, you add the global_macros template to the list of global templates in Word. Anyone on the network who wants to use the global_macros template has to follow these steps.
To change the location of the startup files
- On the Tools menu in Word, click Options, and then click the File Locations tab.
- Under File types, select Startup, and then click Modify. The Modify Location dialog box appears.
- From the Look in list, navigate to the location of global_macros.dot, and then click OK.
- Click Close.
This change enables Word to load the template automatically at the start of each session.
To add the template to the list of global templates
- On the Tools menu, click Templates and Add-ins.
- In the Templates and Add-ins dialog box, click Add.
- Navigate to global_macros.dot, and then click OK.
The template appears in the Checked items are currently loaded list, and Word automatically selects the check box next to the template name.
Selecting the check box enables Word to make the macros in the template available for use in all of your documents. If you need to discontinue using the template, clear the check box.
Repeat these sets of steps as needed for each of the users who require the template.
Here’s a bit of background information about this process: Whenever you create a new document, Word applies a template to that new file. By making the macros template available globally, you enable Word to aggregate those macros together with the template that is attached to the document (usually Normal.dot). The effect is seamless, meaning that the user sees the macros as though they reside in the document.
A note about testing and security
If you’re going to deploy macros from a central share, consider setting up a test environment and testing any macros there before you deploy them to a large group of users. You don’t need to do anything complicated. For example, you can create a share with limited access. You can place a copy of your macro template on that share and then test any new macros there.
Finally, you should implement a high level of security for the template as well as for your macros. For example, you can assign read-only permissions to everyone except those people with the right to add or change the macros in the template.