Solved

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

Posted on 2012-04-02
7
19 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically. To use this feature for other documents there are two steps involved,   1.  Prepare your document for a table of contents (he…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

776 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