programatically setting text border on the bottom

S

sean_n

The following jscript code will create a word doc with "hello world"
and draw a border around it (looks like a box around the words).

word=WScript.CreateObject("Word.Application");
word.visible = true;
doc = word.documents.Add();
word.selection.typetext("hello world");
b = word.selection.borders;
b.enable = true;


Instead of drawing a box all the way around the words, I just want the
bottom border drawn. Any suggestions?
 
S

sean_n

Not sure if this is the best way, but it seems to only draw the bottom
border.

word=WScript.CreateObject("Word.Application");
word.visible = true;
doc = word.documents.Add();
word.selection.typetext("hello world");
b = word.selection.borders;
b.enable = true;
b.Item(1).LineStyle = 0;
b.Item(2).LineStyle = 0;
b.Item(3).LineStyle = 1;
b.Item(4).LineStyle = 0;


Please let me know if there's a better way. Thank you.
 

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