Open password protected word and excel file programmatically

The Edraw Excel Viewer Component and Word Viewer Component support to ppen password protected word and excel file programmatically. You need call the SetValue method to set the password and writepassword before you call the Open method.

boolean SetValue([in] BSTR Name, [in] BSTR Value);
Sets the pasword, writepassword, domain and protectmodereminder
for the document.
Name: The name string.
Value: The value string.
Example
The following vb script shows how to open a password-protected document. if the 1.docx file
has the password 1234, the writepassword 5678, you can use the follow sample.
Sub SetValue_Example()
edword.SetValue “Password”, “1234”
edword.SetValue “WritePassword”, “5678”
edword.Open “c:\1.docx”
End Sub

Clear the ActiveX CAB file from IE Cache

For IE7 or IE8, you can delete the IE Addon with the follow method:
 
1. Open a new Internet Explore.
 
2. Go to Internet Explorer, and click the “Tools” button in the left of browser, and then click Manage Add-ons. 
 
3. Click Toolbars and Extensions 
 
4. Double Click the add-on you want to delete. In the pop up message box, you can click the Delete button in the bottom.
 
For IE6, you can delete the IE Addon with the follow method:
 
IE Toolbar > Options > General > Setting > View Object… 

Then delete the Edraw Viewer Component for Word.

Office Component System Requirements

Edraw compnent system requirements

Hardware :
Minimum:
Pentium Based MMX processor 500 MHZ
256 MB of ram
SVGA Graphics card
64 MB HardDisk
Recommended:
Intel Celeron or AMD Duron 1 GHz and above
1 GB ram
SVGA Graphics card with some acceleration (1024x768x16bitsColor)
Software :
Minimum:
Windows 2000 with IE6 and above.
Recommended:
IE 6/7/8
Windows 2000/XP/2003/Vista/Windows 7
Office 2000/XP/2003/2007/2010
For web application: The component need IE Protection Mode was Turn Off.
You can added your site at the IE trusted site list to turn off the IE protection mode
automatically when the users visit your site with the component.
Please consider also your application’s requirements.

Open a Stream from Server without temporary file

In Office Viewer new version, you can use OpenFileFromStream to open a appointed file or open a file in database.

Either you want to open an appointed file or open a file from database, for client side, all what you need do is the
same, like following:

m_oEdrawOfficeViewer.HttpInit();
m_oEdrawOfficeViewer.HttpAddpostString(L”DocumentID”, L”Tester.doc”);
m_oEdrawOfficeViewer.HttpOpenFileFromStream(strDownloadPath,varOpt,varOpt,varOpt);

Before you call function HttpOpenFileFromStream, you should do two things, one is to initialize http for clearing all parameters and cookies in http, another thing is to appoint the file or database record. And then use HttpOpenFileFromStream to send the request to the destinated webpage.
Before HttpOpenFileFromStream send request, it will add a couple of parameters automatically.
m_OAHttp.AddPostArgument(L”EDA_GETSTREAMDATA”, L”EDA_YES”);
This couple of parameters tell the destinated webpage OfficeViewer will received file as stream.

At the web side, webpage will decide to read which file or database reacord accordding to the post parameters.
And you should add boundary flag ‘EDA_STREAMBOUNDARY’ to file data, following is the asp.net demo.

if (Request.Params["EDA_GETSTREAMDATA"] == “EDA_YES”)
{
  String fullFileName = Server.MapPath(Request.Params["DocumentID"]);
  Byte[] fs = File.ReadAllBytes(fullFileName);

  Response.Write(“Get Stream Successfully!”);
  Response.Write(“EDA_STREAMBOUNDARY”);
  Response.BinaryWrite(fs);
  Response.Write(“EDA_STREAMBOUNDARY”);
}

How to Save the opened file to server?

Yes, EDraw Web Office Component provides a “save” method to save the opened file to a web server or local hard disk.

[id(27), helpstring("Saves the document to specified location or its original location.")]
boolean Save([in, optional] VARIANT SaveAsDocument, [in, optional] VARIANT WebUsername, [in, optional] VARIANT WebPassword);  

For example:

OA1.Save

OA1.Save “c:\temp.doc”

OA1.Save “http://www.ocxt.com/demo/upload.aspx“, “username”, “password”

 

ActiveX control Definition

An ActiveX control is essentially an OLE or Component Object Model (COM) object. It is a self-registering program or control; that is, it adds registry entries for itself automatically the first time it is run.

An ActiveX control can be as simple as a text box, as complex as an Office Viewer Component, and in some cases as complex as a small application. ActiveX controls are used as controls or dialogs for Internet Web sites, as add-ins to major applications from third-party vendors, and as plug-in utilities. Therefore, ActiveX is synonymous with Java, Netscape plug-ins, and scripting. However, the advantage of ActiveX over these other programming options is that ActiveX controls can also be used in applications written in different programming languages, including all of the Microsoft programming and database languages.

ActiveX controls are not stand-alone solutions. They can only be run from within host applications, such as Internet Explorer, a Microsoft Visual Basic® application, Visual C++® development system, Visual Basic, Delphi, DotNet for Applications, and so on. ActiveX controls facilitate the distribution of specialized controls over networks and the integration of those controls within Web browsers. This includes the ability of the control to identify itself to applications that use ActiveX controls.

ActiveX controls can be scripted from Web pages. This means you can use an ActiveX control to provide a control for a user interface or graphics device interface element. Once created, you can use a scripting language such as Visual Basic Scripting Edition (VBScript) or JavaScript to use the control. Your script instructs the control how to work.

EDraw Office Viewer Component is a standard ActiveX Control. It can be intergrated into the other develop circumstance supports the ActiveX Control.

regsvr32 fails to DllRegisterServer in Vista

Question 

I am using Vista Beta 2 and Web Office Component with Visual Studio 2005.

When attempting to register a COM object (e.g. Active-X component or OCX) with ‘Regsvr32’, i.e.: regsvr32 COM

it fails with a message box displaying:

DllRegisterServer in COM failed.
Return code was: 0×80070005

Where ‘COM’ is the name of the COM object file.

CAUSE

This behavior may occur if you try to register a DLL by using Regsrv32 while you are logged on using an account that does not have administrative credentials, such as an account that is a member of the standard users group. An account that does not have administrative credentials cannot write to the registry or change files in the System32 folder.

The behavior occurs because Windows XP and Windows Server 2003 use a more restrictive security scheme than earlier versions of Windows use. This scheme prevents standard users from registering DLLs.

There are some solutions as follow:

1. Login in as Administrator.

2. Set “Run as Administrator” property of regsvr32.exe  

3. Turned off UAC (User Account Control) in Vista OS.

System Requirement for EDraw Office Viewer Component

The client needs Microsoft Office installed. If you want to view the Microsoft Word document, you need Microsoft Word installed in your cient.

If you are doing the web application with the EDraw office Viewer Component, you can choose the any type server such as Linux, Unix or Windows.

  • Support Office 2000/XP/2003/2007
  • Support Windows 2000/XP/2003/Vista

Note: Please test our product before you buy our product firstly.

Creating the CAB files for Office Viewer Component

If your control will be used on web pages, it is very convenient to distribute it as a .cab (cabinet file)This is a compressed archive – the classic use is to put the .cab file on a web server, and refer to it from web pages that host the control. Internet Explorer is smart enough to download and install the control if it is not already installed on the client machine, and to selectively update any files that are newer in the .cab file. Microsoft provides Makecab.exe for creating and editing .cab files.

In the install directory you can find the CAB file. We have created it for you. But if you want to create a new CAB file with the Office Viewer Component, you can download the CabArc.Exe from Microsoft official site.

About the Digital Signatures / Code Signing

An ActiveX control is an application that can run inside Internet Explorer. When an ActiveX control is signed, it indicates that the control was produced by the signer and has not been altered. EDraw Office Viewer Component is signed by EDrawSoft, and you will not be prompted to install an unsigned control or a control signed by anyone else while using EDraw Component.

By default, Internet Explorer allows signed ActiveX controls to run and you should be prompted to install the EDraw signed ActiveX control. If you have changed your Internet Explorer Security Settings, take the follow steps to ensure that you are able to install the EDraw Office Viewer ActiveX Control:

  1. Select Tools, then Internet Options from the menu at the top of the Internet Explorer window. The Internet Options section will appear.
  2. Select Security from the list of tabs at the top of the Internet Options window. The Security section will appear.
  3. Select the Custom Level button. The Security Settings window will appear.
  4. Scroll down to the Download signed ActiveX controls entry and select the prompt radio button.
  5. Scroll down to the Run ActiveX controls and plugins entry and select the enabled radio button.
  6. Select the OK button to accept the changes.
  7. You will now be prompted to accept signed ActiveX controls from websites that you visit.