Embed Word 2003 Viewer/Word 2003 in VB6 Form for readonly file access

Posted on 2006-05-08
Last Modified: 2012-05-05

I would like to use the MS Word 2003 Viewer to allow users to view but not edit files in a VB6 app. The PC inquestion also has full Office 2003 on it. How can I embed one of these apps in a Vb6 form and prevent file changes -i.e. is it better/earier to use the Full Word 2003 with no save option?


Question by:ajmcqueen
    LVL 44

    Assisted Solution

    Hello ajmcqueen,

    you could see if embedding the document in an olecontainer is an alternative, embedding a viewer on a form could become difficult if at all possible


    hope this helps a bit
    LVL 6

    Assisted Solution


    One way to do it is to add a web control to your form and then "navigate" to the document....

    WebControl1.Navigate2 "C:\Test.doc"

    You can then use the ExecWB method to set things like toolbars etc.

    HTH :)
    LVL 19

    Accepted Solution

    Dim wordDoc As Object
    Set wordDoc = CreateObject("Word.Application.8")

    With wordDoc
       .Documents.Open FileName:="C:\Test.doc"
       .Visible = True
       .DisplayAlerts = False
       .CommandBars("Menu Bar").Controls("&File").Controls("Save &As...").Enabled = False
       .CommandBars("Menu Bar").Controls("&File").Controls("Save").Enabled = False
    End With


    Author Comment

    I split the points as all the suggestions have merit but none quite solve my particular problem in the way that I want. I am going to take a different approach and probably use Group policy to bleck access.

    Thanks any.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now