UserForm is not visible

G

Gunnar

Hi there.

I have a template with the userform frmMain.
On this frmMain I have several buttons that creates and opens new documents
based on different templates.

When I have created a new document, filled it with the desired text and
saved it, I close it.
But when this document is closed, my frmMain is NOT visible. Only the
template containing my frmMain is showing, but the frmMain is not visible.

The reason is probably that I have the code frmMain.Hide in the code that
fills out my new document with text.
But this was neccesary, or else the frmMain was placed in front of my newly
created document.
I had to close the frmMain to get to my newly created document so I could
edit it some and then save/close it.

I don't want to close my frmMain until I'm all finished with all my new
documents.
The frmMain contains a lot of textboxes the the user fills out and all this
text goes into some bookmarks on the different documents.
So I have to have access to my frmMain after closing my newly created
documents.

I have figured out that VBA doesn't support the use of modal and modeless on
the forms.
Is there any other way to switch focus between documents/userforms??

Hope this makes any sense.

Gunnar
 
M

Malcolm Smith

Gunnar

Now THIS is an instance where one shouldn't be using magic forms! :)


Okay, you've created your instance of frmMain; which I take is in a
start-up template?

After selecting the document type you .Hide form main? Then why not .Show
it again later on?


This is what I do with my personal code; I have a pick-list of templates
which then creates a new document based on that template.

Regards
- Malc
www.dragondrop.com
 
J

Jonathan West

Hi Gunnar,

I would guess you are using Word 97, since you are saying that the forms
cannot be displayed modeless? With Word 2000 and later you can show forms
modelessly. Please confirm the version you are using, as the advice you need
will vary somewhat depending on this.
 
V

VikingS6

Yes Jonathan, taht is correct. It's Word 97. I can not change this, because
I'm doing this on the computer at my work, and they don't plan to upgrade to
a newer version in yet some time.

Hope you can help me.

Gunnar
 
V

VikingS6

Hi Malcolm.

I know about the .Show method, but the frmMain is hidden from within the
code of the template (project.dot), so I can show the newly created
document.
And when this new document is closing, I want to make frmMain reappear.
But I can't figure out where to put that in code??

Gunnar
 
M

Malcolm Smith

Let me consider this for a while... Been a long time since I did Word 97
and am trying to remember what I did.

- Malc
 
M

Malcolm Smith

Am having problems thinking about this, but what if one has a hidden form
with a Timer control on it which, every second or so, sees if there are no
forms visible and then, if so, .Show your instance of the frmMain ?

Just a thought.

- Malc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top