Hack 9 Tweak the New Document Task Pane![]() ![]() Task Pane introduced in Word 2002, and poor documentation along with bad behavior has only hurt its case. This hack offers some tips on taming the worst offender: the New Document pane.Many users find the New Document pane a welcome relief from the clutter of the Templates dialog, which is packed with obscure tabs (as shown in Figure 2-18). Othersparticularly those who use many different templatesabhor the extra step needed to get to the Templates dialog, now that the Task Pane comes first. But like it or not, you expect the Task Pane to behave as advertised. Yeah, right. Figure 2-18. The Templates dialog grows more crowded with each release![]() 2.8.1 Disabling the Task Pane When Word StartsIn a perfect world, you could select Tools "Startup Task Pane" box to disable the Task Pane. But for many Word users, this setting has absolutely no effect.The fix is a registry hack that will put the Task Pane back in its place.
regedit to open the registry editor. Navigate to the following key: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\Locate the subkey named DoNotDismissFileNewTaskPane and either delete it or set its value to 0.Close the registry editor and restart Word. The Task Pane will now dutifully obey the checkbox on the View tab. 2.8.2 Add Documents and Templates to the Task PaneThe New Document Task Pane includes several default options for creating new documents, including access to templates on the Microsoft web site, as shown in Figure 2-19. Figure 2-19. The New Document Task Pane![]() become visible only after you've done certain things in Word (such as creating a document based on a template other than Normal.dot). The four sections are the following:NewTemplatesRecently used templatesOther files In addition to templates, the "Recently used templates" section contains any documents on which you've recently based a new document.In VBA, you can add items to and remove items from each of the four sections using the NewDocument property. In Figure 2-20, new documents (with rather silly names) have been added to each section. Figure 2-20. The four sections of the New Document Task Pane![]() 2.8.3 The CodeThe NewDocument property has two methods: Add and Remove. The syntax for the two methods is identical. The syntax for Add follows: Application.NewDocument.Add(FileName, [Section], _The brackets imply that you need only the FileName argument, but if you omit the DisplayName argument, you will not actually add anything to the Task Pane. You will, however, gunk up your registry with a useless entry.You can use the arguments for Add to specify the following information:FileName The actual name of the file, including the path, or a URL. Section The section of the New Document Task Pane where the link will appear. You can use the following four Office VBA constants (their actual values are shown in parentheses): msoNew(1) The "New" section msoNewfromExistingFile(2) The "Recently used templates" section msoNewfromTemplate(3) The "Templates" section msoBottomSection(4) The "Other files" section (default) DisplayName The name of the file or URL as it will appear on the Task Pane. Action What happens when you follow the link to the file. You can use the following three Office VBA constants (their actual values are shown in parentheses): msoEditFile(0) Opens the file or template for editing (default). msoCreateNewFile(1) Creates a new document based on the document or template. msoOpenFile(2) Opens the file as if it were an external hyperlink (you'll get the File Download dialog box, even for files on your hard drive). Use this option when creating hyperlinks on the Task Pane. The following macro adds the template MyTemplate.dot to the "Templates" section: Sub AddTemplateToTaskBar( )Because the syntax for the Remove method is identical to the syntax for Add, the following macro removes the same MyTemplate.dot file from the Task Pane: Sub RemoveTemplateFromTaskBar( )Again, note that you must include the DisplayName argument to actually remove the file from the Task Pane. 2.8.4 Hacking the HackIf you hack with the above functions for any amount of time, you'll likely end up with a few items on your Task Pane that you just can't shake. And there's no way, using VBA, to get a list of the items currently placed there.To do some housecleaning, you'll need to hack the registry. Choose Start regedit. Navigate to the following key, which lists any entries you've added to the New Document pane: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\New DocumentRegardless of the FileName or DisplayName used in VBA to create the Task Pane entries, in the registry, the entries are always named Custom1, Custom2, and so on. After you delete them from the registry, they won't reappear the next time you open the New Document pane. To delete one of the entries, select it (as shown in Figure 2-21) and choose Edit Figure 2-21. Cleaning out items from the New Documents Task Pane![]()
using a .reg file. The following .reg file creates a new entry in the "Other files" section of the New Document Task Pane with a link to the O'Reilly web site, as shown in Figure 2-22: Windows Registry Editor Version 5.00Notice that the values for Action and Section correspond to the values described earlier in the syntax for the Add method (well, except for all the leading zeros).Because you can easily distribute registry files across an office, this way you can add an intranet link or other useful shortcut to a user's Word workspace. Figure 2-22. Putting an Internet hyperlink on the Task Pane![]() |