Using VBScript with the MODI Viewer Control

F

Francis

Hi! Please Help! I've run into a dead-end trying to use the MODI
ActiveX control with VBScript. I need to access the Document object. I
have an HTML page with the <object> tag. I DO have the object model
help file, downloaded from Microsoft. (This is Office 2003).


I can access the MiDocViewer objects just fine by referring to the ID
of the control, for example:
viewCtl.PageNum=0, to go to the first page

To access the other needed functions, I need to get to the document
object. There is a "Document Property" (you can load the image using
this), and the "Document Object". In VBScript, you need to use
"CreateObject("MODI.Document") , don't you?

This does not work (file not loaded into control "viewCtl")
dim doc
set doc=CreateObject("MODI.Document")
doc.Create(IMAGE_PATH)
set viewCtl.Document=doc
msgbox(doc.Images.count)

Nor does this (file already loaded into control "viewCtl")
dim doc
set doc=CreateObject("MODI.Document")
doc=viewCtl.Document
msgbox(doc.Images.count)

I didn't include the HTML, but here's the object tag I used:

<OBJECT id="viewCtl" height="600" classid="CLSID:EF347A62-
BA21-42E4-94A0-1C0A6D7FDFE7" >
<PARAM name="_cx" value="10605">
<PARAM name="_cy" value="11769">
<PARAM name="ActionState" value="0">
<PARAM name="DocViewMode" value="0">
<PARAM name="FitMode" value="0">
<PARAM name="FileName" value=""> </OBJECT>

Can anyone tell me if I'm doing something wrong, or does the MODI
activeX control just not work with VBScript? Thanks for any replies!

--- Francis
 
K

Kelly VanDusen

I've been fighting with this for two days. I want to display a TIFF image in
a web page and allow the user to print it. The Apple QuickTime control works
well for display but does not print.

Now I've got the MODI control to open a grey box on my page but IE will not
let it go any further. It complains that I am using a dangerous ActiveX
control. When I try to close the page, IE aborts.

From everything I've seen, this control is only intended for use within a
VB6 Windows form.

url:http://www.ureader.com/msg/11061126.aspx
 
A

Alvin Bruney [ASP.NET MVP]

Put your website in the trusted zone (hope for the best) and it should work.
An activeX control doesn't know where it will be rendered so it doesn't
care. What you are getting is a 'safe for scripting' prompt. By the way, you
should avoid VB6 code if at all possible.

--
Regards,
Alvin Bruney

Auther Plug
OWC Blackbook now on download at www.lulu.com/owc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top