VB/Word - Making lines read only

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Phillip Wu (pwu_at_qantas.com.au)
Date: 08/27/04


Date: 26 Aug 2004 21:59:04 -0700

Hi,

I'm trying to write an Visual Basic application that starts Microsoft
Word to allow a user to edit a text file.

However the first line is a header and the last line is a trailer and
I don't want the user to delete these lines. Also when the user exits
from Word (closes the file or exits Word) I want the control to be
returned to the VB application so that I can update the trailer.

I am new to VB with Word so please bear with me. There are not many
resources on the Web to assist.

What I need to know is:
1) Is there an easy way to make the line read-only? Line in this case
is the same as the Sentences object. If not would I have to trap all
the insert/replace/delete events and beep if the user is on the first
or last line?

2) Is there some sample code showing how I can start Word in VB AND
take back control when the user closes the file?

Thanks for any assistance



Relevant Pages

  • Re: Exit Edit Box on Form
    ... put some code in the OnEnter method of your second control to ... > Hi - I've got a form which has only one Edit Box on it. ... > box, or a Button, and make it a tabstop, then the OnExit stuff will fire. ... > The problem with that is that when the user exits one of the other forms ...
    (alt.comp.lang.borland-delphi)
  • Re: VB/Word - Making lines read only
    ... > from Word I want the control to be ... > returned to the VB application so that I can update the trailer. ... You can break the document in three sections: header, body, trailer, and ... put the appropriate event code in your VB app. ...
    (microsoft.public.word.vba.general)
  • Re: Help with electric brakes
    ... control for the trailer brakes. ... Moving the control all the way caused ... I can not get the trailer brakes to lock the wheels as the setup ... The thing is warranted, of course, but the dealer is an hour ...
    (rec.outdoors.rv-travel)
  • Help with electric brakes
    ... I just got my new Fun Finder X travel trailer today. ... Moving the control all the way caused ... The control unit is a Tekonsha Escort Sensor. ... The light changes from green to red, but the braking effect is very small. ...
    (rec.outdoors.rv-travel)
  • Re: Semi Semi Truck Drivers
    ... >I would have to watch someone to believe that they could back up ... > the trip's would not help, just to many joints to control being pushed. ... > would if it was a single trailer because it would slow down the ... I did not mean to imply that longer trailers were "more stable" only that it ...
    (misc.transport.trucking)