How to declare variable properties?

0

0-0 Wai Wai ^-^

Sorry I am a macro idiot.
How to declare variable properties?

[PS: I tried to use "search" in http://word.mvps.org/Search/index.htm, but an
error was always no matter what I keyed in]

--
Additional information:
- I'm using Office XP
- I'm using Windows XP

¥»¤Hªº¯à¤O«D±`¦³­­. ¦p¦³¤£·í¤§³B, ±æÃѪ̤£§[½ç¥¿!!
My ability is very limited. Hope you will not mind to enlighten me if I do
wrongly.
 
A

Andrew Savikas

It's not clear what you mean by "variable properties". Are you looking for information on VBA (macro) variables?

You should declare your variables at the start of your procedure, using the "Dim" keyword (short for "Dimension")

Dim str As Strin
Dim i As Intege
Dim para As Paragrap
Dim bool As Boolea
.... etc

If the variable is for a data type (like Integer, String, Boolean, Long, Date), you can initialize it with a simple "=" assignment

str = "Foo the Bar
i =
bool = Fals

You need the "Set" keyword to initialize an object variable
Set para = ActiveDocument.Paragraphs(1

But this isn't really the place for a tutorial on VBA variables and data types. Can you be more specific with your question?

----- 0-0 Wai Wai ^-^ wrote: ----


Sorry I am a macro idiot
How to declare variable properties

[PS: I tried to use "search" in http://word.mvps.org/Search/index.htm, but a
error was always no matter what I keyed in

--
Additional information
- I'm using Office X
- I'm using Windows X

¥»¤Hªº¯à¤O«D±`¦³­­. ¦p¦³¤£·í¤§³B, ±æÃѪ̤£§[½ç¥¿!
My ability is very limited. Hope you will not mind to enlighten me if I d
wrongly
 

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