Dropdown list in a WORD Text sentence - Can I do this ???

G

gravesen

I do have a small question that I would like to ask.

When insering the sentence I would like to be abble to choose betwee
some different words in a drop down. Do you know how I can make
dropdown in the macro on just one word and add 3 or 4 extra possibl
words.

If I look at this code:
------------------------------------
Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
ActiveDocument.Unprotect Password:="LGravessen"

Selection.TypeText Text:= _
"We are looking for an established company who can represent us i
Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der ka
repræsentere os i Italien."
ActiveWindow.ActivePane.Close

ActiveDocument.Protect Password:="LGravessen", NoReset:=False, Type:
_
wdAllowOnlyFormFields
End Sub


-----------------------------------------

I choose one sentence and this is inserted. But as u see I have Ital
and would like to have a drop down in the letter where I can choss
England, USA and so on.

Any help would be ever so nice :)

Thanks
Lars Gravese
 
D

Doug Robbins - Word MVP

You could use a couple of input boxes as follows:

Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
ActiveDocument.Unprotect Password:="LGravessen"

Dim Country1 As String, Country2 As String
Country1 = InputBox("Enter the name of the country for the English Text.",
"Enter Country")
Country2 = InputBox("Enter the name of the country for the Foreign Text.",
"Enter Country")
Selection.TypeText Text:= _
"We are looking for an established company who can represent us in " &
Country1 & "."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der kan
repræsentere os i " & Country2 & "."
ActiveWindow.ActivePane.Close

ActiveDocument.Protect Password:="LGravessen", NoReset:=False,
Type:=wdAllowOnlyFormFields
End Sub


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
G

gravesen

When I click on a button a macro runs the insert of my translated text
This works very fine. But the text that is inserted into the documen
is what I want to be abble to change again, well I would like to chang
a word in the sentence through a dropdown and without using form tha
are locked.

If I click on a sentence a english version could be "I have a house an
are happy".
This is inserted into the document with the macro. I would like to ad
a combobox when inserting the sentence. This means that when I have th
sentence in my document I can click on the word house and choose other
like car, boat and so on. The combobox is becaurse I don't want an
locked form. I am using this code for a combobox, but this is for whe
I have a combobox in the document I want this created when and with th
sentence I insert!

Please please any help on this on :-
 
G

gravesen

I am usiing this for my normal combobox:


-------------------------------

Private Sub Document_Open()
Dim vColor, vColors
vColors = Array("Green", "Red", "Blue")


For Each vColor In vColors
ComboBox1.AddItem vColor
Next
ComboBox1.ListIndex = 0
ComboBox1.AutoSize = True
End Sub
-----------------------------------------------

But would like to have the combobox created with the sentence. For th
sentence inserted I have this macro:

-------------------------


Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'

Selection.TypeText Text:= _
"We are looking for an established company who can represent us i
Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der ka
repræsentere os i Italien."
ActiveWindow.ActivePane.Close

End Sub
 
D

Doug Robbins - Word MVP

Have your macro button open a userform that contains a combobox populated
with the items from which you want to choose.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top