Solved

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

Posted on 2012-04-02
7
21 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

735 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