o***@gmail.com
2006-05-04 18:42:23 UTC
I've seen this topic discussed many times in this group, but I've never
seen what is ultimately the best practice of creating a window that
should not modal (i.e. shows while the document can be edited) and
should not obscure any part of the document.
It's desirable to have a solution for a few recent versions of Word,
not only the last one (2003).
The following is the summary of all ways I know to achieve the subject
:
- there are task panes (in 2003) non-programmable in VBA. They say you
can program it with VB.NET because the task pane is a "managed"
control, but I'm not sure it's worth the trouble of switching to
another platform and losing backward compatibility. Anyway, it works
only for 2003.
- to create a command-bar with custom controls pretending to be
buttons. This one looks to be too hacky and not guaranteed to work on
all machines.
- to create a modeless window without docking and then place it over a
task pane, command bar or another "native" dockable panel. A load of
code is required to move/size the window synchronously with the panel.
Alternatively, one can downsize the Word window and place the modeless
window beside.
- to create a modeless window and forget about docking :) Actually, it
may not be that bad solution, but the window unfortunately doesn't look
like a toolwindow and the main window loses active state when the tool
window is activated. In effect, it looks miserable.
I believe that creating a modeless window (tool window) is a common
task for VBA programmers, so there should be a legal and recommended
way of doing this!
Any ideas?
seen what is ultimately the best practice of creating a window that
should not modal (i.e. shows while the document can be edited) and
should not obscure any part of the document.
It's desirable to have a solution for a few recent versions of Word,
not only the last one (2003).
The following is the summary of all ways I know to achieve the subject
:
- there are task panes (in 2003) non-programmable in VBA. They say you
can program it with VB.NET because the task pane is a "managed"
control, but I'm not sure it's worth the trouble of switching to
another platform and losing backward compatibility. Anyway, it works
only for 2003.
- to create a command-bar with custom controls pretending to be
buttons. This one looks to be too hacky and not guaranteed to work on
all machines.
- to create a modeless window without docking and then place it over a
task pane, command bar or another "native" dockable panel. A load of
code is required to move/size the window synchronously with the panel.
Alternatively, one can downsize the Word window and place the modeless
window beside.
- to create a modeless window and forget about docking :) Actually, it
may not be that bad solution, but the window unfortunately doesn't look
like a toolwindow and the main window loses active state when the tool
window is activated. In effect, it looks miserable.
I believe that creating a modeless window (tool window) is a common
task for VBA programmers, so there should be a legal and recommended
way of doing this!
Any ideas?