I am programming in Word and have a combo box that has numbers 1-100. When selected depending on the number a phrase is inserted in the Word document. i have an array , Para(1000). The reason I have 1000 is because Some phrases have more that one paragraphs so if para(62) has 3 paragraphs, I use the other three as Para(621),622,623 etc.
I do this becuse I don't want the user to see a 61 then a jump to 65 in the list box because the other three are part of 62. So I have this in my code:
If ComboBox1.Text = 62 Then
Selection.EndKey Unit:=wdStory
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(621)
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(622)
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(623)
Selection.TypeParagraph
Selection.InsertAfter para(624)
Selection.TypeParagraph
Selection.InsertAfter para(625)
Selection.TypeParagraph
Selection.InsertAfter para(626)
Selection.TypeParagraph
Selection.InsertAfter para(627)
Exit Sub
End If
But this doesn't work. I only get para(627)
Or is there a way I can say
ParaNo = combobox1.text
if (paraNo & 1) ?exists? then
Selection.InsertAfter para(ParaNo & 1)
and go on until there aren't anymore?
Please help
Thanks in advance
ERic
"The greatest risk, is not taking one."
I do this becuse I don't want the user to see a 61 then a jump to 65 in the list box because the other three are part of 62. So I have this in my code:
If ComboBox1.Text = 62 Then
Selection.EndKey Unit:=wdStory
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(621)
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(622)
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertAfter para(623)
Selection.TypeParagraph
Selection.InsertAfter para(624)
Selection.TypeParagraph
Selection.InsertAfter para(625)
Selection.TypeParagraph
Selection.InsertAfter para(626)
Selection.TypeParagraph
Selection.InsertAfter para(627)
Exit Sub
End If
But this doesn't work. I only get para(627)
Or is there a way I can say
ParaNo = combobox1.text
if (paraNo & 1) ?exists? then
Selection.InsertAfter para(ParaNo & 1)
and go on until there aren't anymore?
Please help
Thanks in advance
ERic
"The greatest risk, is not taking one."