Solved

How to hide Microsoft Word while at the same time displaying a user form

Posted on 2012-04-02
7
12 Views
Last Modified: 2016-04-09
Hello -  I need to know how to hide/display the body and menues of Microsoft Word (2003, 2010) and only show a user form. I have tried the Application.Visible feature, but I have onbtained different results.

Any assitance on the matter, I will be very appreciative.


Thank you,


TC
0
Comment
Question by:TonyChacon
7 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 37795267
Visible would be my immediate response so can you define different results the better to try and help?

Chris
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37795287
Try this code:
Sub HideAppShowForm()
    Application.Visible = False
    UserForm1.Show vbModal
    Application.Visible = True
End Sub

Open in new window

0
 

Author Comment

by:TonyChacon
ID: 37799078
Thanks Chris for your quick response.

The above code does not quite solve my need.  What I need to do is the following:

1.  Display only the user form when when Word file is open and hide everything else.
2.  I would like to display word only when the user clicks on a button.

   Here the code that I have so far:

      Private Sub chkBoxHideWord_Click()
            If chkBoxHideWord.Value = True Then
               Application.Visible = False
            Else
              Application.Visible = True
           End If
End Sub

The issue with the above code is that it does not hide the Word with all its menues.


Thanks again!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 37799549
Does not hide ... Can I ask when .... It's fine in 2003 as far as I can see, btw that was Graham's code not mine

Chris
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 37799807
I haven't had issues with menu etc being hidden, I did test an implementation and had issues with the form itself being hidden.  The following is the code in a normal I was using to launch the form:

Sub test()
    UserForm1.Show vbModeless
End Sub

Open in new window


In the form I eventually landed on:

Private Sub chkBoxHideWord_Click()
    With ThisDocument.ActiveWindow
        If chkBoxHideWord.Value = True Then
            .Visible = False
            Me.Show vbModeless
        Else
            .Visible = True
        End If
    End With
End Sub

Private Sub UserForm_Activate()
    ThisDocument.ActiveWindow.Visible = False
    Me.Show vbModeless
End Sub

Private Sub UserForm_Terminate()
    ThisDocument.ActiveWindow.Visible = True
End Sub

Open in new window


This seems to close the application from view and retain form visibility in 2003 without any issues in testing so far.

Chris
0
 
LVL 13

Expert Comment

by:frankhelk
ID: 41542649
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now