Solved

minimizing userforms

Posted on 2001-06-16
11
254 Views
Last Modified: 2010-05-02
I know this is a simple question but I cannot find an answer anywhere.

I want a userform to have the three standard options that all forms have (Minimize - change the amount occupied in a screen -- and close). Word 97 says you should be able to do this. All forms are supplied with this they say. Trouble is I cannot make it happen and there are no directions anywhere. Does anyone know how to do this?

If I succeed, will I be able to move around on the document that called the form? (Will the form now be modeless which is the actual object of my question)

Thank you so much

jcherry_99@yahoo.com
0
Comment
Question by:jcherry_99
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 8

Expert Comment

by:glass_cookie
Comment Utility
Is there something like...

Form1.Windowstate = 0

Or

Form1.Windowstate = 1

Or

Unload Form1?

Where Form1 is the name of the form?
0
 
LVL 4

Expert Comment

by:wileecoy
Comment Utility
A simple solution would be to see if your form has the BorderStyle set to something other than 2.

0 - None (no border at all)
1 - Fixed Single (no minimize, maximize, but has "X")
2 - Sizable (all 3 options)
3 - Fixed Dialog (no minimize, maximize, but has "X")
4 - Fixed Tool Window (no minimize, maximize, but has "X")
5 - Sizable Tool Window (no minimize, maximize, but has "X")

hth.
0
 

Author Comment

by:jcherry_99
Comment Utility
These solutions look correct,but word 97 does not have the ability to go beyond window 1. Is there some way I can force it to give window2 sizable.

Thank you so much.

Jerome
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
Is it possible to post some code you use for?
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
I think you are asking about Word - Macros.

So, could you try this:

ThisDocument.ActiveWindow.WindowState = wdWindowStateMaximize

ThisDocument.ActiveWindow.WindowState = wdWindowStateMinimize

like that.

Is it, this one, you are asking for?

Cheers.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:jcherry_99
Comment Utility
Dear Valli

You have the right idea. That would be the code if I could use it. The problem is that word 97 will not accept it as valid code. I want to minimize a user form so it has to be userform rather than activedocument.

Or have I misread something? (Active window is not an option after userform for userforms in Word 97) .

Thank you so much

Jerome
0
 

Author Comment

by:jcherry_99
Comment Utility
Dear Glass Cookie
See the previous comment. It has to be a little more indirect, because Word 97 only allows you to go to state 1. State 2 is what I want ideally, but no can do.

Jerome
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
I hope, you could not have a control box, for Userform, since it appears to be a dialog box interface like form, if I understood.

See this link:
http://www.microsoft.com/officedev/articles/Opg/001/001.htm

I just tried. You could use UserForm1.Hide and another button, may be in the document, with UserForm1.Show.

You could also, try UserForm1.Height and UserForm1.Width properties, as you require.

Hope this helps.



0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 50 total points
Comment Utility
For the maximising part, youmay have to do some trial and error thing to maximise your app.

You could do something like:

Me.Move 0, 0, 13000, 9000

If 13000 is the screen's width and 9000 is the screen's height.

Another RADICAL (use it if you're really desperate for it), really really RADICAL option would be to add a little button with a caption or some sort of indication that it's to minimise the form.

Upon clicking that button, the form would shrink (Me.Move 0, 0, 30, 30 - I measured it) until only the title bar and a little bit of the form could be seen.  Of course, the button would have to me Top=0 and Left=0 and has to be a small size.  Upon clicking the button again, make the form back to it's original height.  Remember about changing the caption part upon clicking.

As for me, I couldn't find any other method (I use Word 97 also ;) ) which is similar to shrinking the form to the taskbar.

That's it!

glass cookie : )
0
 

Author Comment

by:jcherry_99
Comment Utility
The problem is that this is still a modal form even if it is shrunk. It really has to go to the taskbar not to be modal. Damn too bad. It makes my application hopeless.

Take good care

Jerome

Ps I'll award the points.
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
you tried Hide and Show methods, also? I tried, it worked, with Hide method, and a Command button to Show it, in Word '97. The userform is not in taskbar. If I had understood properly...

Cheers.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

10 Experts available now in Live!

Get 1:1 Help Now