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

Tip: Looking for answers? Try searching our database.

using drop down field in macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
schip - 21 Nov 2007 21:16 GMT
I have a from with drop down fields that I would like to be able to use with
a macro.  When I try to create the macro, it allows a place for the drop down
but I cannot include the list in the drop down while in the macro. I have
only been able to run the macro and then add the list to the fields then.  I
want the list to be included in the macro. Is this possible?
Russ - 21 Nov 2007 23:11 GMT
Schip,
Word2007?
Is this a listbox in a document with formfields or a listbox in a userform
popup dialog window?
Are you recording a macro while using the menus? It would help us, if you
said what menus choices you are using. Then we would have a better idea of
what kind of dropdown you are talking about.

What is the source for populating your drop down list?
Is it already available or do you need to provide new list data each time?

You may have to use a userform popup dialog to enter a list of choices for
your macro.

> I have a from with drop down fields that I would like to be able to use with
> a macro.  When I try to create the macro, it allows a place for the drop down
> but I cannot include the list in the drop down while in the macro. I have
> only been able to run the macro and then add the list to the fields then.  I
> want the list to be included in the macro. Is this possible?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

fumei - 27 Nov 2007 19:14 GMT
>I have a from with drop down fields that I would like to be able to use with
>a macro.  When I try to create the macro, it allows a place for the drop down
>but I cannot include the list in the drop down while in the macro. I have
>only been able to run the macro and then add the list to the fields then.  I
>want the list to be included in the macro. Is this possible?

We definitely need more information.  I have no doubt that you can get the
list into a macro.

What kind of a dropdown?  How did you make it?
schip - 29 Nov 2007 15:37 GMT
The form is for other users to complete by choosing from the drop down menu.  
This is the beginning:  

Patient presents for injection #(drop down with #1-5) of (drop down w/left
knee, right knee, bilateral knees)

Pain: (drop down with Improved Same Worse)

Swelling: "

Activity level:  "

I have created the form with the drop downs, but instead of having a "hard
copy" form I wanted the user to be able to use a macro on a clean word
document and get all the info.    So I was able to create a simple macro and
add drop down fields in the places indicated above, but I cannot add the
items into the drop down while recording the macro.  

I don't know if that explains anything any better, I think I have actually
even confused myself with that explanation!

Thanks

> >I have a from with drop down fields that I would like to be able to use with
> >a macro.  When I try to create the macro, it allows a place for the drop down
[quoted text clipped - 6 lines]
>
> What kind of a dropdown?  How did you make it?
fumei - 29 Nov 2007 21:40 GMT
Well you certainly did not help all that much.

Just a note/suggestion.

The stuff about the patients, their knees, their pain, is TOTALLY irrelevant.
It means nothing to us.  The actual items, the text of what those items are,
is absolutely irrelevant.  If an item is "Jupiter", or "Zimbabwe", or "corn",
or "wsgfjhskdgh" makes no difference at all.

PLUS: when you mention youi made a macro...do you notthink it may (it may not.
..but it may) help if you told us what it IS.  As in...post some code?

PLUS: it is not helpful at all when you do not answer questions.  You were
asked directly "What kind of dropdown?  How did you make it"

If you do not bother to answer, then you simply are not going to get much
assistance...no matter how much we would like to.

>The form is for other users to complete by choosing from the drop down menu.  
>This is the beginning:  
[quoted text clipped - 24 lines]
>>
>> What kind of a dropdown?  How did you make it?
David Sisson - 30 Nov 2007 18:31 GMT
Sounds like the dropdowns are on your document.  If that is the case,
you can unporotect your document, right click on the dropdown, and
select properties.  From here you can manually add the dropdown items,
but there is a limit of 25 per dropdown.  If you want more, you'll
have to use a dropdown on a userform.
schip - 30 Nov 2007 21:02 GMT
Sorry.  I am very new at this and guess I don't know what terms I should be
using. I understand the actual text is irrelevant, I was hoping to just show
what I was trying to do.  

As far codes for the macro go, I am just so elementary that I don't know
what you mean.  If I should have copied some  of it to show, here it is:  
Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
   Selection.TypeText Text:=" of "
   Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
   Selection.TypeParagraph
   Selection.TypeParagraph
   Selection.TypeText Text:="Pain:  "
   Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown

.... but that includes my irrelevant text so I don't know if that is what
you wanted or not.  

Lastly, I would like to say I was surprised by your response.  My impression
was this was a board for help on any level, didn't realize I needed to be on
a higher level to qualify.   Don't need the attitude, I have my own.

> Well you certainly did not help all that much.
>
[quoted text clipped - 42 lines]
> >>
> >> What kind of a dropdown?  How did you make it?
David Sisson - 30 Nov 2007 22:44 GMT
How about this?
Sub ChooseMe()
Selection.FormFields.Add Range:=Selection.Range,
Type:=wdFieldFormDropDown

ActiveDocument.FormFields(1).DropDown.ListEntries.Add "This is option
1.1"
ActiveDocument.FormFields(1).DropDown.ListEntries.Add "This is option
1.2"

Selection.TypeText Text:=" of "

Selection.FormFields.Add Range:=Selection.Range,
Type:=wdFieldFormDropDown
ActiveDocument.FormFields(2).DropDown.ListEntries.Add "This is option
2.1"
ActiveDocument.FormFields(2).DropDown.ListEntries.Add "This is option
2.2"

Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Pain:  "
Selection.FormFields.Add Range:=Selection.Range,
Type:=wdFieldFormDropDown

End Sub
schip - 03 Dec 2007 17:31 GMT
Thanks so much!  That is what I was trying to do.  

> How about this?
> Sub ChooseMe()
[quoted text clipped - 22 lines]
>
> End Sub
 
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.