Use Word just as a viewer (no menus, toolbars or ribbons)

B

Bill Devel

From my own application (Visual Basic) I need to show Word Documents that can
only be read on screen to a variety of users with different Word versions. No
options to save or print.

I do this from VBA by hiding menus and toolbars in Word 2000 and Word 2003.

But it doesn't work with Word 2007 because the following commands are ignored:

CommandBars("Ribbon").Visible = False
CommandBars("Ribbon").Enabled = False

I know VSTO has objects to access the ribbon, but I can't use VSTO objects
from my application.

Any suggetions?

Thank you very much.
Bill
 
G

Graham Mayor

If you think that hiding the toolbars will stop users from printing or
saving the document then you are mistaken. There is no way on earth that you
can force someone to run your code. That would be an open invitation to
virus writers.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bill Devel

I appreciate your oppinion, but in fact I force users to run my code because
is the only way they can access certain restricted Word documents.

Also, I know hiding menus or toolbars doesn't guarantee that users can't
copy the documents, but my customers feel more comfortable if these options
are hidden.

So, I still wonder:

Can I hide the ribbon using VBA code?

Why Word seems to ignore this code?

CommandBars("Ribbon").Visible = False
CommandBars("Ribbon").Enabled = False

Thank you.
Bill
 
T

Tony Jollans

Can I hide the ribbon using VBA code?

No, nor any other way. You can minimise it (Window.ToggleRibbon) or view in
full screen mode (Window.View.FullScreen=True) but, whatever you do, the
user can get the ribbon back - that's the way it's deliberately designed.

You can make your own Ribbon with only the commands you want on it, but you
always have to have a ribbon.
 

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