Word and VB Help

  • Thread starter News.Microsoft.com
  • Start date
N

News.Microsoft.com

I have a piece of code in my vb app that opens up a Word document and then
fills in bookmarks with fields from a vb form. The problem that I am having
is that the fields that I am filling in have underlines and as I fill in
text it is in insert mode and pushes the lines over and messes up the page
formating. How do I turn off insert mode form VB. Here is a sample of my
code.

Dim MyWord As Word.Application

Set MyWord = New Word.Application
With MyWord
.Visible = True
.Documents.Open ("c:\BuildingChangeForm.doc")
.ActiveDocument.bookmarks("BuildingName").Select
.Selection.TypeText USIComboRead(cmbBuilding)


Thanks in advance for any help anyone can offer.

Bill
 
J

Jay Freedman

There's no good way to solve this problem from VB. The right way is to
set up the base document properly. Build it with one or more tables,
and make the underlines by selectively turning on the bottom borders
of some of the cells. Place the bookmarks in the cells.

See section 2 of
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm for
details.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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