Solved

minimizing userforms

Posted on 2001-06-16
11
255 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Vlookup to move data back to source. 4 84
MS Access Search and Replace Using VBA 6 57
How does CurrentUser work? 10 31
Exit a vb6 apps when a calling it apps closes 15 43
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

896 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

12 Experts available now in Live!

Get 1:1 Help Now