Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » COM/ActiveX » Web Browser control and open a MSWORD...


Web Browser control and open a MSWORD...Expand / Collapse
Author
Message
Posted 12/18/2009 11:58:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/17/2010 3:24:02 PM
Posts: 2, Visits: 7
Hello everyone!

I am very new to VB .net and windows programmig, but over a few days have read a few articles. Hence I need some help from you guys!

I am trying to create a DLL file which would be called from a HTML using javascript. I am using a COM class in my VB .NET application. It is COM visible and members along with Functions are set COM visible.

The idea is to use the Web Browser control and open a MSWORD document inside the IE frame. I am struggling a lot with this. If there are any experts out there, can they please share the steps I need to perform to do this. Here is what I have done so far with no success.

1) Created a VB .net project with a COMClass. Com visibility is set true for most of the memebers and functions.

2) Added reference to System.windows.forms to get hold of the usercontrol and web browser (here i am trying to create the UI to hold the web browser control) I try to set all this in the New() i.e contructor of the class.

3) Added a reference to Interop.Word so that I can cast the document given by the webbrowser control to a MSWORD instance and access its properties.

My projects builds without any problems. But in the javascript, it throws error when I try to access the DLL files members or function. I am lost and wonder if I can make it work.

Any suggestions are valuable. Thanks!

Post #28564
Posted 7/17/2010 3:34:29 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/17/2010 3:24:02 PM
Posts: 2, Visits: 7
Hello,

I got it working, so sharing with you guys.

The problem was I never created an Interface which would be exposed to external programs. My VB .NET class implements this interface. All the methods, attributes which would be needed by the external program should be defined in the interface and implemented in the class accordingly. The classid of the interface can be used directly in the javascript code to invoke my activex object. Also, the class needs to be made COM visible.

It would have been very simple to implement what I needed, if I had some clear understanding of VB .net programming! Nonetheless, I implemented it anyways (pheeww)

Hope this would be helpful to others.

Post #29437
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 3:01am