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 / February 2007

Tip: Looking for answers? Try searching our database.

Modifying arrays in a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kiwi Pom - 08 Feb 2007 02:51 GMT
I have a Word (2002) form, widely distributed throughout an organisation.
The form has a number of combo boxes, each of which contains greater than 25
items. I have therefore set up a macro with an array for each combo box hard
coded with the combo box items.
These items may change several times during the year. I need a method to
change the array values WITHIN THE MACRO without going into the code, as
changes will be made by someone who knows nothing about VBA.
Any ideas along with sample code would be appreciated, as I am a VBA novice.
Many thanks
Jezebel - 08 Feb 2007 03:11 GMT
Put the source data into an external format that is easy to edit. Flat text
files and Excel spreadsheets are both easy to work with from VBA.

To read a text file into an array --

Dim pFilenum as long
Dim pData() as string
pFilenum = freefile
open "MyFile" for input as #pFilenum
pData = split(input(lof(pFilenum),pFilenum), vbcr)
close pFilenum

>I have a Word (2002) form, widely distributed throughout an organisation.
> The form has a number of combo boxes, each of which contains greater than
[quoted text clipped - 8 lines]
> novice.
> Many thanks
Kiwi Pom - 08 Feb 2007 04:16 GMT
Thanks,

I'll give it a try.

> Put the source data into an external format that is easy to edit. Flat text
> files and Excel spreadsheets are both easy to work with from VBA.
[quoted text clipped - 20 lines]
> > novice.
> > Many thanks
 
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.