Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2008

Tip: Looking for answers? Try searching our database.

DSOFramer Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aaron - 10 Mar 2005 21:07 GMT
I am using the DSOFramer Control to display Office Documents in a Windows App
per the instructions of Mr. Clement.  Although it has made several things
easier, I am still having troubles finding documentation over two specific
issues.  

One - When I load the document, a space where the reviewing toolbar should
be shows up.  The toolbar itself does not appear, but there is a place for it
and it is selected in the right-click menu.  I have set the toolbar property
of the DSO control to false and I have tried doing it before and after I load
the document, however this space still appears.  This space gives the user
the ability to right-click and add other menus.  When I do right-click and
add another menu, it causes a painting error to where a new space shows up,
but with the painting from the top ruler.  Basically, what I need is a way to
programmatically remove the "Reviewing" toolbar so that space doesn't show
up.  I cannot allow the user the ability to right-click and add toolbars.

Two - I need the document to be read-only.  I tried casting the document to
a Microsoft.Office.Interop.Word.DocumentClass, which casts okay, but the
ReadOnly property of this class is readonly.  Meaning I can't set the
ReadOnly property to true.  So, how do I get the document to be completely
uneditable when the document is viewed?

Thanks in advance,
Aaron
Aaron - 10 Mar 2005 22:45 GMT
I was able to fix both of these issues.  For anyone else having the same
issues, here is the code that fixed each one:

object refmissing = System.Reflection.Missing.Value;
//Fixes the read only issue
axFramerControl.Open(filename,true,refmissing,refmissing,refmissing);
            axFramerControl.Toolbars = false;
            axFramerControl.Menubar = false;
            axFramerControl.Titlebar = false;       
//Fixes the Reviewing Bar appearing issue
Microsoft.Office.Interop.Word.DocumentClass myDoc =
(Microsoft.Office.Interop.Word.DocumentClass)axFramerControl.ActiveDocument;

myDoc.CommandBars["Reviewing"].Visible=false;

Thanks,
Aaron

> I am using the DSOFramer Control to display Office Documents in a Windows App
> per the instructions of Mr. Clement.  Although it has made several things
[quoted text clipped - 20 lines]
> Thanks in advance,
> Aaron
Aaron - 11 Mar 2005 00:59 GMT
Sorry, but the code for read only on my first reply does not work.  If you
have the answer to my read only problem, please help.

Thanks,
Aaron

> I am using the DSOFramer Control to display Office Documents in a Windows App
> per the instructions of Mr. Clement.  Although it has made several things
[quoted text clipped - 20 lines]
> Thanks in advance,
> Aaron
Justin Steele - 05 Apr 2005 16:59 GMT
Hi Aaron,

I am using the DSOFramer Control in a very similar way. To make it to the
user cannot modify the file I protect all but formfields. Since, I don't
use form fields on the document I'm previewing so the whole document is
essentially protected then. Here's some code to get you going and tickle
your brain... (I use a VB project to do most of the Word interop calls but
I have tried to convert all code to C# here):

object objFalse = false;
object protection = Word.WdProtectionType.wdAllowOnlyFormFields;

((Word.Document)axDSOFramer.ActiveDocument).Protect("password", objFalse,
protection);

This isn't the most informative and I'm sure you'll have questions.
Hopefully it will help.  Feel free to ask questions, I'll do my best to
answer them.

Justin
jayshree - 17 Apr 2006 15:48 GMT
I tried the code that u were running Aaron and it works fine for me, yes of
coz it has that visibiliy tweek which gives the user an a feel that they can
edit the document. I am working on this one and let u know if at all i get
somewhere, however if at all there is another solution ot the problem u can
save the doc as html file n show it thru Iframe n all. I hope this helps
will update u if i get something :)
Jyothirmai Yepuri - 21 May 2007 14:48 GMT
I am using DSoFramer control to host Word Document in my windows based
application.
I am getting following exception while opening document in DsoFramerControl
'Parameter is Incorrect'
I have done as per the article http://support.microsoft.com/kb/828100
still problem persists
help needed

also can anybody tell how to disable save, open and new toolbar buttons?
fcuaranta - 31 Jul 2008 08:11 GMT
You can put your dsoframer on a panel & when you want to set the read only,
set the panel property  enable to false that should work !!!!

but I think its to late 2008

Felipe Cuaranta (Charro amarillo)

>I am using the DSOFramer Control to display Office Documents in a Windows App
>per the instructions of Mr. Clement.  Although it has made several things
[quoted text clipped - 20 lines]
>Thanks in advance,
>Aaron
fcuaranta - 31 Jul 2008 08:11 GMT
You can put your dsoframer on a panel & when you want to set the read only,
set the panel property  enable to false that should work !!!!

but I think its to late 2008

Felipe Cuaranta (Charro amarillo)

>I am using the DSOFramer Control to display Office Documents in a Windows App
>per the instructions of Mr. Clement.  Although it has made several things
[quoted text clipped - 20 lines]
>Thanks in advance,
>Aaron

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.