Posted by office viewer on May 5th, 2007
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.
Posted by office viewer on May 4th, 2007
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.
Posted by office viewer on May 3rd, 2007
Automation is a process that allows applications that are written in languages such as Visual Basic .NET or C# to programmatically control other applications. Automation to Word allows you to perform actions such as creating new documents, adding text to documents, mail merge, and formatting documents. With Word and other Microsoft Office applications, virtually all of the actions that you can perform manually through the user interface can also be performed programmatically by using automation. Word exposes this programmatic functionality through an object model. The object model is a collection of classes and methods that serve as counterparts to the logical components of Word. For example, there is an Application object, a Document object, and a Paragraph object, each of which contain the functionality of those components in Word.
You can call the interesting methods and properties that Microsoft Word provides to you to manipulate documents in Word. The best way to learn how to navigate the object models of Word, Excel, and PowerPoint is to use the Macro Recorder in these Office applications:
1. Choose Record New Macro from the Macro option on the Tools menu and execute the task you’re interested in.
2. Choose Stop Recording from the Macro option on the Tools menu.
3. Once you are done recording, choose Macros from the Macro option on the Tools menu, select the macro you recorded, then click Edit.
This takes you to the generated VBA code that accomplishes the task you recorded. Keep in mind that the recorded macro will not be the best possible code in most cases, but it provides a quick and usable example.
For example to open an existing file and append some text:
object fileName = “c:\\test.doc”;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
Word.ApplicationClass oWordApp = new Word.ApplicationClass();
EDrawOfficeViewer1.Open(ref fileName, ref missing, ref missing);
Word.ApplicationClass oWordApp = EDrawOfficeViewer1.GetApplication();
oWordApp.Selection.TypeText(”This is the text”);
oWordApp.Selection.TypeParagraph();
Posted by office viewer on May 2nd, 2007
EDraw Office Viewer Component also supports a property called Dispatch that allows you to obtain a reference to the IDispatch interface of the embedded object. From this interface you can automate the object to perform tasks, edit parts of the document, or gather information about what a user has added or removed. For example, if you have a Word document open, you can use code that resembles the following to add a line of text:
Sub OfficeAutomationDemo()
WebOffice1.CreateNew “Word.Document”
Set objWord = WebOffice1.GetActiveDocument
objWord.Content.Text = “This was added by Automation”
End Sub
Recent Comments