How do I . . .

D

Dawn Crosier

Jim -

I'm sorry that I have not been able to get back with you. I have been out
of the office supporting a Seminar that our firm was putting on. Good thing
Jonathan & Charles were here to answer your questions.

If you haven't already figured out, you need to put the following code in
your Module which is contained in your Memorandum.dot template.

At the very top of your module, if you don't already have it type in Option
Explicit. That way you will get Intellisense when you are typing your code.
So for instance in the below code, when you type the name of your form and
then type a period, you will see all the properties and events which you can
use such as Show or Hide

Public Sub Autonew()
'rename the frmNewClient to the name of the UserForm you created
frmClient.Show
End Sub

When you are ready to hide your UserForm, the command is frmClient.Hide

Hiding the form will leave the variables loaded. To release them from
memory, use

Unload frmClient

Hope that helps.

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and questions to
the newsgroup so that others can learn as well.
 
J

Jean-Guy Marcil

Dawn Crosier was telling us:
Dawn Crosier nous racontait que :
Jim -

I'm sorry that I have not been able to get back with you. I have
been out of the office supporting a Seminar that our firm was putting
on. Good thing Jonathan & Charles were here to answer your questions.

If you haven't already figured out, you need to put the following
code in your Module which is contained in your Memorandum.dot
template.
At the very top of your module, if you don't already have it type in
Option Explicit. That way you will get Intellisense when you are
typing your code. So for instance in the below code, when you type
the name of your form and then type a period, you will see all the
properties and events which you can use such as Show or Hide

Sorry to drop in like that, but I thought I'd correct something for the
benefit of anybody still following this thread.

Option Explicit does not activate Intellisense. Even without it, if you have
a userform called frmTest, then typing
frmTest followed by a dot will bring up the list of
methods/properties/controls associated with frmTest.

Option Explicit is, however, a very good idea in that it prevents us from
being lazy and letting the compiler make assumptions when it shouldn't. That
is, if you have Option Explicit, then the following code will not compile:

Option Explicit
Sub Test()

Set myRange = Seletion.Range
MsgBox myRange.Text

End Sub

Because of Option Explicit, when you compile, you will get an error message
stating that myRange has not been defined.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Dawn Crosier

Jean-Guy -

Thank you for the correction! Of course you are correct. I have gotten in
the habit of using Option Explicit and remember that there has been a time
when Intellisense did not work, so....

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and questions to
the newsgroup so that others can learn as well.
 
S

Steve Rindsberg

Jean-Guy -

Thank you for the correction! Of course you are correct. I have gotten in
the habit of using Option Explicit and remember that there has been a time
when Intellisense did not work, so....

If you choose Tools, Options in the IDE and go to the Editor tab, you can put a
check next to "Require variable declaration"

That'll cause the IDE always to insert Option Explicit when you add a new
module.

In the same dialog box there are some other options that turn the various
IntelliSense features on and off. I'm guessing that that's where the confusion
arose.
 

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