Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: Can someone give some pointers for creating a userform?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Can someone give some pointers for creating a userform?
"njmike[ at ]gmail.com" <njmike[ at ]gmail.com> 03.08.2006 19:07:32
I have a nice collection of macros, so I thought I would start to look
into making a userform. Regularly, I need to run a few macros on a
group of files. I have created a macro that does this, but I need to
go in to in VBA and manually edit the folder to look in and then enter
whatever macros I want to run. I've come up with two ideas to do
this more efficiently, but I'm not sure how to properly do either.

My first thought was that I could have an input box pop up when it
comes time to enter the folder and another input box pop up to choose
the macro. I'm not against this, but now I'm thinking a userform would
work better. I'm envisioning a userform where there would be a field
to enter the name of the folder or hit "Browse..." to search for it,
and a dropdown list, where you could choose the macro. Actually, even
better would be a list where you could choose multiple macros to be run
at once. That would be followed be a "Start" button.

I've pretty much figured out how to set up the userform, but I don't
know what specific code would go behind it. I've been searching and
searching, but I can't come across anything specific.

Thanks in advance,
- Mike

Re: Can someone give some pointers for creating a userform?
"Charles Kenyon" <wordfaq[ at ]nospam.addbalance.com> 03.08.2006 20:44:53
Start here:
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


<njmike[ at ]gmail.com> wrote in message
news:1154632052.710558.26240[ at ]i42g2000cwa.googlegroups.com...
[Quoted Text]
>I have a nice collection of macros, so I thought I would start to look
> into making a userform. Regularly, I need to run a few macros on a
> group of files. I have created a macro that does this, but I need to
> go in to in VBA and manually edit the folder to look in and then enter
> whatever macros I want to run. I've come up with two ideas to do
> this more efficiently, but I'm not sure how to properly do either.
>
> My first thought was that I could have an input box pop up when it
> comes time to enter the folder and another input box pop up to choose
> the macro. I'm not against this, but now I'm thinking a userform would
> work better. I'm envisioning a userform where there would be a field
> to enter the name of the folder or hit "Browse..." to search for it,
> and a dropdown list, where you could choose the macro. Actually, even
> better would be a list where you could choose multiple macros to be run
> at once. That would be followed be a "Start" button.
>
> I've pretty much figured out how to set up the userform, but I don't
> know what specific code would go behind it. I've been searching and
> searching, but I can't come across anything specific.
>
> Thanks in advance,
> - Mike
>


Re: Can someone give some pointers for creating a userform?
"njmike[ at ]gmail.com" <njmike[ at ]gmail.com> 04.08.2006 12:02:10
Thank you, Charles, but I've already followed that tutorial. I need
something slightly more advanced. Basically, I need to know what the
code would be for creating a list. I also need to know how to make an
input box that would have a "Browse" button to find a folder to run the
macro(s) chosen in the list on its documents.

Charles Kenyon wrote:
[Quoted Text]
> Start here:
> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> --
> Charles Kenyon
>
> Word New User FAQ & Web Directory: http://addbalance.com/word
>
> Intermediate User's Guide to Microsoft Word (supplemented version of
> Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
>
> See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
>
> My criminal defense site: http://addbalance.com
> --------- --------- --------- --------- --------- ---------
> This message is posted to a newsgroup. Please post replies
> and questions to the newsgroup so that others can learn
> from my ignorance and your wisdom.
>
>
> <njmike[ at ]gmail.com> wrote in message
> news:1154632052.710558.26240[ at ]i42g2000cwa.googlegroups.com...
> >I have a nice collection of macros, so I thought I would start to look
> > into making a userform. Regularly, I need to run a few macros on a
> > group of files. I have created a macro that does this, but I need to
> > go in to in VBA and manually edit the folder to look in and then enter
> > whatever macros I want to run. I've come up with two ideas to do
> > this more efficiently, but I'm not sure how to properly do either.
> >
> > My first thought was that I could have an input box pop up when it
> > comes time to enter the folder and another input box pop up to choose
> > the macro. I'm not against this, but now I'm thinking a userform would
> > work better. I'm envisioning a userform where there would be a field
> > to enter the name of the folder or hit "Browse..." to search for it,
> > and a dropdown list, where you could choose the macro. Actually, even
> > better would be a list where you could choose multiple macros to be run
> > at once. That would be followed be a "Start" button.
> >
> > I've pretty much figured out how to set up the userform, but I don't
> > know what specific code would go behind it. I've been searching and
> > searching, but I can't come across anything specific.
> >
> > Thanks in advance,
> > - Mike
> >

Re: Can someone give some pointers for creating a userform?
"Jonathan West" <jwest[ at ]mvps.org> 04.08.2006 12:17:45

<njmike[ at ]gmail.com> wrote in message
news:1154692930.042526.247790[ at ]s13g2000cwa.googlegroups.com...
[Quoted Text]
> Thank you, Charles, but I've already followed that tutorial. I need
> something slightly more advanced. Basically, I need to know what the
> code would be for creating a list.

Create a listbox on your userform. Then put something like the following
into the UserForm_Initialize event

ListBox1.List = Array("Apples", "Oranges", "Pears", "Apricots", "Plums")

> I also need to know how to make an
> input box that would have a "Browse" button to find a folder to run the
> macro(s) chosen in the list on its documents.


Look up the FileDialog object in the Word VBA help


--
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

Re: Can someone give some pointers for creating a userform?
"Greg Maxey" <gmaxey[ at ]mvps.org> 04.08.2006 13:17:56
Mike,

You might download and review a few Add-ins available on my site:

http://gregmaxey.mvps.org/VBA_Find_And_Replace.htm

http://gregmaxey.mvps.org/Bookmark_Tool.htm

I think you will find code in one or both of them that will get you
started.


njmike[ at ]gmail.com wrote:
[Quoted Text]
> Thank you, Charles, but I've already followed that tutorial. I need
> something slightly more advanced. Basically, I need to know what the
> code would be for creating a list. I also need to know how to make an
> input box that would have a "Browse" button to find a folder to run the
> macro(s) chosen in the list on its documents.
>
> Charles Kenyon wrote:
> > Start here:
> > http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> > --
> > Charles Kenyon
> >
> > Word New User FAQ & Web Directory: http://addbalance.com/word
> >
> > Intermediate User's Guide to Microsoft Word (supplemented version of
> > Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
> >
> > See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
> >
> > My criminal defense site: http://addbalance.com
> > --------- --------- --------- --------- --------- ---------
> > This message is posted to a newsgroup. Please post replies
> > and questions to the newsgroup so that others can learn
> > from my ignorance and your wisdom.
> >
> >
> > <njmike[ at ]gmail.com> wrote in message
> > news:1154632052.710558.26240[ at ]i42g2000cwa.googlegroups.com...
> > >I have a nice collection of macros, so I thought I would start to look
> > > into making a userform. Regularly, I need to run a few macros on a
> > > group of files. I have created a macro that does this, but I need to
> > > go in to in VBA and manually edit the folder to look in and then enter
> > > whatever macros I want to run. I've come up with two ideas to do
> > > this more efficiently, but I'm not sure how to properly do either.
> > >
> > > My first thought was that I could have an input box pop up when it
> > > comes time to enter the folder and another input box pop up to choose
> > > the macro. I'm not against this, but now I'm thinking a userform would
> > > work better. I'm envisioning a userform where there would be a field
> > > to enter the name of the folder or hit "Browse..." to search for it,
> > > and a dropdown list, where you could choose the macro. Actually, even
> > > better would be a list where you could choose multiple macros to be run
> > > at once. That would be followed be a "Start" button.
> > >
> > > I've pretty much figured out how to set up the userform, but I don't
> > > know what specific code would go behind it. I've been searching and
> > > searching, but I can't come across anything specific.
> > >
> > > Thanks in advance,
> > > - Mike
> > >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net