?
Solved

minimizing userforms

Posted on 2001-06-16
11
Medium Priority
?
271 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
[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
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6198587
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
ID: 6198804
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
ID: 6199045
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Expert Comment

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

Expert Comment

by:Valliappan AN
ID: 6199732
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
 

Author Comment

by:jcherry_99
ID: 6199864
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
ID: 6199871
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
ID: 6200027
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 150 total points
ID: 6200040
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
ID: 6214323
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
ID: 6214864
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 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