Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create pop-up menu/list box in word document

Status
Not open for further replies.

hubong

Programmer
Jun 30, 2003
1
US
Part 1: Does anyone know how to insert a macro (or attach visual basic code to a word document) that will link texts to a table, thus updating the table automatically. For example, I have a table that contains a Requirement section as a column (with all Requirements beginning with RR), another column listing the Detail Designs (DD..) that corresponds to a particular Requirement. Is there a way to create a macro so that when a user highlights a word (anywhere in the document) and activates the macro, it brings up a popup menu asking if the using wants to add this word to an internal list of Requirements or Detail Designs, or take it out of the list. The word will automatically be added to or removed from the lists depending on which choice the user selects. And when you click on a word that's already in a list, it brings up a popuplist containing all the requirements in one column and the Detail Designs in another. The user can then click to go to any Requirement or Detail Design in that document. I'm thinking I might need to use Win32 api, but I'm not quite sure how or if that works with macros or if a popup list/menu or whatever is possible within a word document. At least help with how to create a macro that brings up a popup Menu/list (similar to the one that comes up when the user clicks the right mouse button) when a word is clicked.

Part 2: When a user adds a word to the list of Requirements, the requirement column of the table is updated. When the user clicks to add a word to the list of Detail Designs, another popup list comes up to ask what Requirement this Design corresponds to so that the word is added to the correct cell in the Detail Designs column. This might be easier with a popup Menu.

Another way to go about doing this whole thing is to actually attach the "add to Requirements/Detail Designs", or "Delete from Requirements/Details Designs commands" to the actual popup menu that comes up when the user clicks the right mouse button after highlighting a word. How do you go about it this way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top