VBA
Fri Dec 12 14:48:32 CST 2003
Yes, I was able to get it to work in Word. By making my UserForm non-Modal,
I can allow my user to keep the UserForm open while they make changes to the
document. Then they can go back to the UserForm and re-enter criteria that
updates their document (via bookmarks and VBA code). Plus, I am able to
keep the UserForm open while I debug my application by stepping through my
code and watch what happens on my document - makes it real nice for
debugging purposes.
I did however, abandon this method for a much better method, but I will
leave it up to the end-user to decide which way they like best. I took
PeterS' suggestion to hide the UserForm with button, and create a Floating
PopUpMenu with a single button that will allow the user to "Show" the
UserForm:
Private Sub btnHide_Click
Me.Hide
ShowPopUpFormButton
End Sub
Public Function ShowPopUpFormButton()
Dim myBar As CommandBar
Dim graphBtn As CommandBarButton
Dim bFound As Boolean, sToolBarName As String
sToolBarName = "ShowForm"
' Check if the PopUp Form already exists. If so, just show it, otherwise,
create it
For Each myBar In CommandBars
If Left$(myBar.Name, Len(sToolBarName)) = sToolBarName Then
bFound = True
Exit For
End If
Next
If bFound Then
CommandBars(sToolBarName).Visible = True
Else
Set myBar = CommandBars.Add(Name:=sToolBarName,
Position:=msoBarFloating, _
Temporary:=True)
myBar.Visible = True
Set graphBtn = myBar.Controls.Add(Type:=msoControlButton)
With graphBtn
.Caption = "Show Form"
.Style = msoButtonCaption
.DescriptionText = "Show Form"
' When clicked, run the Macro to Show the Form
.OnAction = "ShowMacroForm"
End With
End If
End Function
"PeterS" <anonymous@discussions.microsoft.com> wrote in message
news:080c01c3c0ed$28b09870$a001280a@phx.gbl...
>
> >-----Original Message-----
> > Thank you.
>
> You are welcome.
>
> > I found "Steve Bullen's" web site,
> >
http://www.bmsltd.co.uk/Excel/Default.htm. I will let
> > you know if I can get it to work in Word. It looks
> > pretty straightforward.
>
> I played around with it a bit. Fairly simple, just import
> the class module, change "XLMAIN" to "OpusApp" (in the
> code), and that's it actually. No sweat. :-)
>
> So, the question remains: what am I getting myself into
> with the use of this code? Drawbacks in Word200X?
> (Actually all I need is the possibility to let the user
> click at the text and modify it there, while the form is
> still displayed.)
>
> See ya
> Peter