?
Solved

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

Posted on 2012-04-02
7
Medium Priority
?
24 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
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 2000 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 14

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
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 …
Suggested Courses

801 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