Discussion:
Invoking New Document TaskPane from VBA Code
(too old to reply)
Tabasco Ed
2005-07-25 13:32:52 UTC
Permalink
How do I invoke the New Document TaskPane from VBA code? I'm thinking
that there is probably some new WordBasic command that does this.
Thanks.
Doug Robbins
2005-07-25 19:53:15 UTC
Permalink
Do you really want the New Document Task Pain or will the following do:

Dialogs(wdDialogFileNew).Show
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Post by Tabasco Ed
How do I invoke the New Document TaskPane from VBA code? I'm thinking
that there is probably some new WordBasic command that does this.
Thanks.
Tabasco Ed
2005-07-26 13:57:38 UTC
Permalink
On Mon, 25 Jul 2005 21:53:15 +0200, "Doug Robbins"
Post by Doug Robbins
Dialogs(wdDialogFileNew).Show
I am well aware of that one. Yes, I want the New Document Task Pain
(I like how you spelled that, it does seem to be a pain). I want to
configure my personal customization add-in to use either the taskpane
or the dialog, depending on the state of a check box and corresponding
registry entry. I have written replacements for some of the standard
menu/toolbar functions, and want to be able to select whether to use
the replacement or standard functionality. If you invoke FileNew
without a replacment function in place, it invokes the taskpane. If I
create a replacement FileNew, that it always run. I want it to say

If replacementregistryentry = True Then
Dialogs(wdDialogFileNew).Show
Else
Invoke taskpane
End If

I can't for the life of me find the command to invoke the taskpane.
The macro recorder won't record it. There is no info in the help file
on it. No answer on Google. But there has to be a command that Word
is executing to make that taskpane appear.
Doug Robbins
2005-07-26 20:39:38 UTC
Permalink
The spelling error was of course deliberate.

Hopefully, the informationa at
http://word.mvps.org/faqs/macrosvba/taskpanesreferencecontentbody.htm will
help.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Post by Tabasco Ed
On Mon, 25 Jul 2005 21:53:15 +0200, "Doug Robbins"
Post by Doug Robbins
Dialogs(wdDialogFileNew).Show
I am well aware of that one. Yes, I want the New Document Task Pain
(I like how you spelled that, it does seem to be a pain). I want to
configure my personal customization add-in to use either the taskpane
or the dialog, depending on the state of a check box and corresponding
registry entry. I have written replacements for some of the standard
menu/toolbar functions, and want to be able to select whether to use
the replacement or standard functionality. If you invoke FileNew
without a replacment function in place, it invokes the taskpane. If I
create a replacement FileNew, that it always run. I want it to say
If replacementregistryentry = True Then
Dialogs(wdDialogFileNew).Show
Else
Invoke taskpane
End If
I can't for the life of me find the command to invoke the taskpane.
The macro recorder won't record it. There is no info in the help file
on it. No answer on Google. But there has to be a command that Word
is executing to make that taskpane appear.
Klaus Linke
2005-07-28 02:20:32 UTC
Permalink
It's tricky...


CommandBars.FindControl(Id:=18).Execute

seems to be the only thing that works.

18 is the Id of the "FileNew" control.


The VBA code you'd normally want to use,
Application.TaskPanes(wdTaskPane???).Visible = True
doesn't work because there's no constant for the "New document" work pane.


WordBasic.FileNew, which should do the same as the working code at the top,
doesn't work, but instead immediately creates a new document.


Regards,
Klaus
Post by Doug Robbins
The spelling error was of course deliberate.
Hopefully, the informationa at
http://word.mvps.org/faqs/macrosvba/taskpanesreferencecontentbody.htm will
help.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
Post by Tabasco Ed
On Mon, 25 Jul 2005 21:53:15 +0200, "Doug Robbins"
Post by Doug Robbins
Dialogs(wdDialogFileNew).Show
I am well aware of that one. Yes, I want the New Document Task Pain
(I like how you spelled that, it does seem to be a pain). I want to
configure my personal customization add-in to use either the taskpane
or the dialog, depending on the state of a check box and corresponding
registry entry. I have written replacements for some of the standard
menu/toolbar functions, and want to be able to select whether to use
the replacement or standard functionality. If you invoke FileNew
without a replacment function in place, it invokes the taskpane. If I
create a replacement FileNew, that it always run. I want it to say
If replacementregistryentry = True Then
Dialogs(wdDialogFileNew).Show
Else
Invoke taskpane
End If
I can't for the life of me find the command to invoke the taskpane.
The macro recorder won't record it. There is no info in the help file
on it. No answer on Google. But there has to be a command that Word
is executing to make that taskpane appear.
Tabasco Ed
2005-08-03 21:22:26 UTC
Permalink
On Thu, 28 Jul 2005 04:20:32 +0200, "Klaus Linke"
<***@fotosatz-kaufmann.de> wrote:

That solution is on the web page that Doug Robbins suggested. I had
already tried that. It seems to work if executed from a module in the
current document. But it does not work if executed from a global
template. I have no idea why.
Post by Klaus Linke
It's tricky...
CommandBars.FindControl(Id:=18).Execute
seems to be the only thing that works.
18 is the Id of the "FileNew" control.
The VBA code you'd normally want to use,
Application.TaskPanes(wdTaskPane???).Visible = True
doesn't work because there's no constant for the "New document" work pane.
WordBasic.FileNew, which should do the same as the working code at the top,
doesn't work, but instead immediately creates a new document.
Regards,
Klaus
Post by Doug Robbins
The spelling error was of course deliberate.
Hopefully, the informationa at
http://word.mvps.org/faqs/macrosvba/taskpanesreferencecontentbody.htm will
help.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
Post by Tabasco Ed
On Mon, 25 Jul 2005 21:53:15 +0200, "Doug Robbins"
Post by Doug Robbins
Dialogs(wdDialogFileNew).Show
I am well aware of that one. Yes, I want the New Document Task Pain
(I like how you spelled that, it does seem to be a pain). I want to
configure my personal customization add-in to use either the taskpane
or the dialog, depending on the state of a check box and corresponding
registry entry. I have written replacements for some of the standard
menu/toolbar functions, and want to be able to select whether to use
the replacement or standard functionality. If you invoke FileNew
without a replacment function in place, it invokes the taskpane. If I
create a replacement FileNew, that it always run. I want it to say
If replacementregistryentry = True Then
Dialogs(wdDialogFileNew).Show
Else
Invoke taskpane
End If
I can't for the life of me find the command to invoke the taskpane.
The macro recorder won't record it. There is no info in the help file
on it. No answer on Google. But there has to be a command that Word
is executing to make that taskpane appear.
Klaus Linke
2005-08-04 02:48:45 UTC
Permalink
Post by Tabasco Ed
Post by Klaus Linke
CommandBars.FindControl(Id:=18).Execute
That solution is on the web page that Doug Robbins suggested. I had
already tried that. It seems to work if executed from a module in the
current document. But it does not work if executed from a global
template. I have no idea why.
Hi Ed,

Strange: I just put it in a global template and it ran without a hitch
(Word2003).
Do you get some kind of error message? If Word can't find the control,
perhaps put FileNew on some toolbar or in some menu in the global template.
Guess the ".Visible" property could be false.

Regards,
Klaus

Loading...