Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

public variables value preserving

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amir - 20 Mar 2005 23:55 GMT
Hi!

I would like to ask a simple question:

If I declare a public variable, which I use for a macro,
will it's value be saved until the next time I run that macro?

I'm not willing to save the value. I just want to know if I can know it'll
be 0 (for an integer) if I don't initialize it manually.
Are there any cases where the value will be saved?

Regards,
Amir.
Jonathan West - 21 Mar 2005 00:11 GMT
> Hi!
>
[quoted text clipped - 6 lines]
> be 0 (for an integer) if I don't initialize it manually.
> Are there any cases where the value will be saved?

The value will be saved until the template is unloaded.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

Amir - 31 Mar 2005 22:25 GMT
Thank you very much!

Regards,
Amir.

>> Hi!
>>
[quoted text clipped - 9 lines]
>
> The value will be saved until the template is unloaded.
Jay Freedman - 21 Mar 2005 00:55 GMT
>Hi!
>
[quoted text clipped - 9 lines]
>Regards,
>Amir.

Hi Amir,

If you don't explicitly save the value before shutting down Word and
explicitly retrieve it on the next startup, there's nothing in Word
that will save it automatically.

If you have more than one document open during a single session,
things can get confusing with public variables. But closing Word will
discard any values that are only in memory.

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
Amir - 31 Mar 2005 22:26 GMT
Thanks!!

Regards,
Amir.

>>Hi!
>>
[quoted text clipped - 24 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org 

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.