This is part of an AutoText Tool I developed (as an adjunct to Word's autotext feature) that allows one to enter data in any of three lists and choose them to be written to the document. I recently added a toggle function whereby one can select ant two items from any of these lists and click a Toggle button. The macro would then alternate writing those selections to the document just by clicking that button.
However, the toggle is limited to the last two selections -- good if one wants only to alternate writing two pieces of text to a document (such as for a script or screenplay with only two character names to precede their dialog). But as I wanted to be able to click a button to write up to ten pieces of text (or character names) without having to select them from any of the listboxes, I hit upon the idea of setting up a separate form with the ten labels you see, and an Edit and Delete command for each. The idea was to allow one to click an Edit button, which would open an input box, type or paste in the text, and do this for however many pieces of text he wants to have so he can just click the button and the application would write its caption to the document. But I wanted to be able to sort those labels alphabetically (to make the text easier to find while typing and clicking the buttons), and thought that the only way to do that was to put the captions in an array, sort the array, and then have the application apply the ordered captions to the labels (instead of actually moving the labels, which was my first thought). I thought that the alphabetical sorting function would be the hardest to achieve, and I was right. But I do not want a listbox because I already have that in the main application (the three listboxes); for this, I wanted to be able to write up to ten pieces of text to the document by just clicking a button. Imagine a script or interview where one has to repeat several speaker names in a document. If there are more than two, the toggle won't be adequate for this, and having to find and select them from a listbox adds mouse action and time. But if I want to be able to choose from among up to ten pieces of text and continually repeat those pieces of text by just clicking a button, this is what I came up with.
The multiclickwrite form I shared on the forum is only part of this AutoText Tool and I wanted to get it working separately before adding it to the main application.
|