VBA Word - Returning variable number of selected chars from a string
Posted on 2003-11-11
In Word I have a bookmark "address" which contains between 4 - 6 lines of text separated by paragraph marks.
I want to select from "address" the first 3 lines of the text (up to but not including the paragraph mark) and put them into a combo box as three separate items. I think the best way to do this will be to put each line of text into its own variable (for e.g., line 1 into variable strAdd1, line 2 into strAdd2, line 3 into strAdd3) and then add the variables to the combo box dropdown list. BUT how do I get VBA to select the text to go into the variables? Line 1 will be everything to the left of the first paragraph mark, line 2 will be everything between the first and second para marks, and line 3 will be everything between the second and third para marks.