Create a scrollable text field


Greg Maxey

In a separate post made in the .Client group, I learned how to add a an HTML
container to my webpages where I can publish large segments of text and
users can scroll through the text in the container:

<pre style="height: 150px; border: 2px solid orange; padding: 5px; width:
875px; overflow:scroll;">&nbsp;</pre>

My text (when inserted) is placed between the <pre> </pre> flags where
&nbsp; is now displayed in the code above.

Attempting to simplify using this technique, I created a FrontPage VBA
procedure (my first) that adds a HTML container at the selection:

Sub InsertHTMLContainer()
Dim objRange As IHTMLTxtRange
Set objRange = ActiveDocument.Selection.createRange
objRange.collapse False
objRange.pasteHTML "<pre style=""height: 150px; border: 2px solid orange;" _
& "padding: 5px; width: 875px;
End Sub

This works to place a container in the webpage, but it places it after the
selected text. I have to perform an extra manual step to cut my selected
text and paste it in the container.
What I would like to do is to select a block of text and insert an HTML
container that contains the selected text. I am very unfamiliar with the
FrontPage object module and through a hour or so of tinkering, I have not
found a solution.

Can this be done?

Thanks for any assistance.

Greg Maxey

See my web site
for an eclectic collection of Word Tips.

Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)


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