Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word in 'Read-Only' and no 'Tool-Bars' 1

Status
Not open for further replies.

gogins

IS-IT--Management
Sep 1, 2001
17
GB
Dear All,

Is it possible to programme and launch a word.application
which to the user will appear:

(a) in 'Read Only' mode
(b) without any toolbars or menues

if so, how?

Many thanks.
 
Gogins,

To open a document as read-only, pass .T. as the third parameter to the Open method. Assuming oW contains an object ref to Word:

oDoc = ow.Documents.Open("test.doc",.T.,.T.)

Re opening Word without toolbars or menus. It's probably possible to open Word and then close the toolbars, although I'm afraid I don't know how. As for hiding the menus, I don't think that's possible, nor is it desirable.

What exactly are you trying to achieve here? If you just want a way of displaying a Word document without any chance of the user interacting with it, maybe the Word Viewer would be a better tool?

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike,

Thanks so much for the
oDoc = ow.Documents.Open("test.doc",.T.,.T.)
It is certainly of great help to me.

What I am trying to do:

1. User selects, from an array of checkboxes, the names
of several letters, eg Accept, Cover, Invoice, Statement etc

2. Using automation, letters are created and placed sequentially in a single .doc file.

3. The unique name of the single file just created can now be seen in a grid.

Steps 1,2,3 above can be repeated, using different selections in step (1), so populating the grid.

4. User can highlight any filename in the grid and can, by clicking buttons on the screen:
(a) View the letter
(b) Amend the letter
(c) Email the letter
(d) Print the letter

HOWEVER: Once a letter has been Emailed in 4c or print-confirmed in 4d, it should NOT be possible for the user to further amend the letter by using 4b.

Thanks to your help I know how to disable 4b (Amend) once the letter has been Sent or Printed via 4c or 4d.

A loophole unfortunately remains: The user can still view the letter in 4a and CAN use Word's Send and/or Print without using my 4c or 4d thus Emailing and Printing without leaving a trace!

I suppose that what I need IS a Word Viewer as you suggested in your response. However, the link in your note does not seem to lead to a .DOC-type viewer?

Phew! hope the above is not too OTT. Many apologies if it is.

many thanks for listening.

 
Gogins,

No, not at all OTT. Your problem is one a familiar one. I've faced similar situations myself.

It sounds like a Word Viewer might solve the problem. In fact, it might also be a good alternative to making the document read-only. After all, the user can still save a read-only document, albeit they must do so under a different filename.

You said: However, the link in your note does not seem to lead to a .DOC-type viewer?

I didn't in fact give you a link <g>. But I'll give you one now:

Hope this helps.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I know I am late on this one but I succeeded in disabling the Word Toolbars leaving only those i want. But the change also affects the appearance of word the next time I open it the normal way. Seems like my change finds its way in Normal.dot. Which that there was a way to point the changes to the current document instead of Normal.dot.
Code:
 ThisDocument.CommandBars("Standard").Visible = False
    ThisDocument.CommandBars("Formatting").Visible = False
    ThisDocument.CommandBars("Tables and Borders").Visible = False
    ThisDocument.CommandBars("Menu Bar").Controls(7).Delete
    ThisDocument.CommandBars("Menu Bar").Controls(6).Delete
    ThisDocument.CommandBars("Menu Bar").Controls(5).Delete
    ThisDocument.CommandBars("Menu Bar").Controls(4).Delete
    ThisDocument.CommandBars("Menu Bar").Controls(3).Delete
    ThisDocument.CommandBars("Menu Bar").Controls(2).Delete
    ThisDocument.CommandBars("File").Controls(6).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(1).Delete
    ThisDocument.CommandBars("File").Controls(3).Delete
    ThisDocument.CommandBars("File").Controls(3).Delete
    ThisDocument.CommandBars("File").Controls(6).Delete
    ThisDocument.CommandBars("File").Controls(6).Delete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top