RE: webbrowser in vb.net



Hello,

The development team confirmed that the control WebBrowser is not able to
directly open a document with ReadOnly. But Microsoft provide another
control to host Office documents: dsoFramer
http://support.microsoft.com/?id=311765
The control (source and sample) can be downloaded at
http://www.microsoft.com/downloads/details.aspx?familyid=CE2CA4FD-2169-4FAC-
82AF-770AA9B60D77&displaylang=en (Microsoft Developer Support Office Framer
Control 1.3 Sample (KB 311765))

Please NOTE: there are some known issues of dsoFramer when it is used to
open Excel workbooks. For instance, it might throw an exception: The
document is not associated with an ActiveX Document server.

The control itself is developed in Visual C++ and it exposes its own
interfaces for Open/Save/Create Office documents. The samples are written
in VB and VB.NET. They show how to use the control to open doc/xls/ppt in
Windows form or web form.

Take the project Vb7TestApp as an example here:
In the sub btnOpenFile_Click of Form1.vb, it creates an object of dsoFramer
(AxFramerControl)
Dim ctl As AxDSOFramer.AxFramerControl
ctl = GetFramerCtlFromIdx(idx)

Then use the control to open a document:
ctl.Open(OFileDialog.FileName)
The control opens file with Modify by default. To make it open with
ReadOnly, we could specify the parameter 'ReadOnly' in the Open method:
ctl.Open(OFileDialog.FileName, True, Type.Missing, Type.Missing,
Type.Missing)
In this way, the doc files with Modify password will be opened without the
password dialog popped out.

In order to hide all the menus, command bars, etc in the control, please
add the following codes after the creation of ctl
ctl.Menubar = False
ctl.Titlebar = False
ctl.Toolbars = False

In order to set the default view of doc as Web View, please add the code
below after the ctl.Open
ctl.ActiveDocument.ActiveWindow.View.Type = 6

When a word document is opened, even with ReadOnly, a edit lock will be
added to the file. If the document is not closed, the next open of the file
will pop out a dialog that says the file is edit locked by another user.
Therefore, if multiple users want to open the file, we could copy the doc
from server to user's clients first, so as to avoid such dialogs.

For more information about dsoFramer, please refer to the KB article
http://support.microsoft.com/?id=311765
If you have any other concern or need anything else, please feel free to
let me know.

Sincerely,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Table relationships
    ... Microsoft IT Academy Program Mentor ... Row Source Type: Table/Query ... Things are better -- when the form opens the name of the first project ... ' Find the record that matches the control. ...
    (microsoft.public.access.formscoding)
  • Re: could not load object...
    ... The message in the box is "Could not load an object bacause ... > and PPT opens it just fine with no error. ... It could be the Microsoft Forms ActiveX control based on the info ...
    (microsoft.public.powerpoint)
  • Re: Want to enable fields after combox selection
    ... and it opens up teh code and highlights HideFormText ... Dim ctl As Control 'Each control on the form ... Dim bSkip As Boolean ...
    (microsoft.public.access.forms)
  • RE: webbrowser in vb.net
    ... When a word document is opened, even with ReadOnly, a edit lock will be ... only one data entry operator will do update this file and the number ... The development team confirmed that the control WebBrowser is not able to ... The control opens file with Modify by default. ...
    (microsoft.public.vsnet.general)
  • Re: Command Button Enabled/Disabled Based on Text in Text Box
    ... See if you have Microsoft ADO XXX checked. ... References dialog. ... Class1 is the name of a control on your form and should be enclosed ... form opens. ...
    (microsoft.public.access.queries)