PDA

View Full Version : need help with Drop Down in Word



Aranell
04-25-2013, 05:24 AM
Hi I'm new here.
I've searched the web and every where, but I couldn't find a solution for my problem.

I'm creating a form in Word, where user have to fill some data enter a date, a Number and choose from a drop down list a company.

Date and the Text field is clear but what about the drop down box?
First problem the Drop down list from word is only restricted in one Row per field, that mean I can choose only the name of the Company but no further information like Address or contact.
Second the Company data are on a separate excel file, I've seen some code to fill a Word userform dropdown list from an excel file. But I don't want to use a userform
I can easily do it on excel, but word.. :dunno :banghead:

I know how to make 2 drop down boxes in word depended on each other so if you select 1 in DropDownbox1 you have the choice to select A in the second box for example. But I couldn't link a dropdown box with a Text field, I could than bypass the one row restriction in the dropdown box and highlight the right address in the text field by selection just the name of the company in the Box.

An other thing is there a way to make a number that increase by 1 each time I open or save the word document??

Like I said I could easily do it in excel but for word I need :help

Thank you very much.

fumei
04-25-2013, 04:03 PM
"An other thing is there a way to make a number that increase by 1 each time I open or save the word document??"

Sure. Use a document variable.Private Sub Document_Open()
MsgBox "This document has been opened " & _
ActiveDocument.Variables("Opened").Value & " times."
ActiveDocument.Variables("Opened").Value = _
ActiveDocument.Variables("Opened").Value + 1
End Sub

"I can easily do it on excel," It is always good to use the best tool. If Excel is the best tool (and I agree), then use it.

"I don't want to use a userform"

So the best solution is Excel...but you don't want to use it. The second best is a userform...but you don't want to use that either.

"I couldn't link a dropdown box with a Text field" Nope.

"highlight the right address in the text field by selection just the name of the company in the Box."

If you know what is "right", why are you making any selection at all. Just use the right thing with no user action.

Please clarify explicitly what you want to happen.

Aranell
04-26-2013, 01:04 AM
First thanks for your help.
Well, I recently joined a small office. We send to our customer Agreements for each their order.
I've notice that my colleague are always using an old agreement as a DOC file and change there the customer Name and data and the quantity of their Order.
I was checking last time, and discovered that every one use his own style, and there are some errors in the Name spelling, or Customer Number or even some time in the price calculation.
I don't know how they did work like that and didn't receive any complains yet from our customer.
Anyway I decided to create for them an Agreement Form, where they can only choose by clicking a date and write the quantity and with a drop down box they can choose the customer.

I thought it would be better for them that I create it in word so you know, it would be easier for them to just have a form where they just have to fill out the blanks.That's why I didn't want to use a userform.

I've already created an Invoice template for them in excel. Because same thing they were using word, and ... ahhh :doh: :hairpull: :banghead: .
There a userform popup you fill in your data click calculate, and automatically it was printed and saved as a PDF file. Believe me it was a huge act to persuade one of my colleague (who think I'm here to take his place) :motz2:

I've just got an Idea, I will finally do it in excel like the invoice program with the option to export it to a doc document if this smart guy feels that he need to add something.