Hello,
I’m driving myself crazy trying to figure out how to refresh the New Document task pane from VBA. I’m trying to hide it then show it (which refreshes its entries if they’ve changed)
The documentation has the following:
Sub showFormatting() Application.TaskPanes.Item(wdTaskPaneFormatting).Visible = True End Sub
But there’s no “wdTaskPaneNewDocument”, and nothing else I’ve tried wants to work.
If anyone has any ideas, I’d be very grateful.
Speaking of the New Document Task Pane, here’s some info I’ve compiled. I hope you find it at least more useful than the atrocious VBA documentation for the Task Pane:
The NewDocument property has two methods, Add and Remove.
The syntax for Add is as follows:
Application.NewDocument.Add(FileName, [Section], [DisplayName], [Action]) as Boolean
The arguments for Add are used as follows:
*FileName
The actual name of the file, including the path. Can also be a URL.
*Section
The section of the New Document Task Pane where the link will appear. The constants shown in the documentation are misleading or non-existent. Use one of the following four values:
1 — The New section
2 — The Recently Used Templates section
3 — The Templates section
4 (default) — The Other Files section
*DisplayName
The name of the file or URL as it is to appear on the Task Pane
*Action
What happens when the link to the file is followed. Again, the constants in the documentation are sketchy, so use one of the following three values:
1 — Create a new document based on this document or template
2 — Follow this link as if it were a hyperlink
3 (default) –Open this document (if it’s a template, it’s opened for editing)
Registry keys for task pane entries:
Recent Templates:
HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordRecent Templates
Other items on New Document Task Pane:
HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordNew Document
Enjoy!