Ah, interesting. What you really need to do is explore whether you can use
JavaScript functions on that page and call them from Visual Basic. Here's a
link to a possibility:

http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/7c81a612b9fd026e

Looks like:

WebBrowser1.Document.parentWindow.execScript "jmolScript(xxxxx)", "JScript"

Or, possibly, to return a value:

x = WebBrowser1.Document.parentWindow.execScript "jmolEvaluate(xxxxx)",
"JScript"


Does that work?

On Wed, Mar 23, 2011 at 9:23 AM, Michael Marden <michael.mar...@inserm.fr>wrote:


> WebBrowser1.Document.All(i).tagNAme
> WebBrowser1.Document.All(i).ID
> WebBrowser1.Document.All(i).Value
>

This is standard MSIE notation, with capitalization.


>
> This seems to give unique values, although many elements have no ID.
>
> For my set up in VB6, I see
>
> *index  tagName    id*
> 0      HTML
> 1      HEAD
> 2      TITLE
> 3      SCRIPT     jmolcmd
> 4      SCRIPT
> 5      SCRIPT
> 6      BODY
> 7      SCRIPT
> 8      OBJECT     jmolApplet0
> 9      BR
> 10     SPAN       span_jmolCmd0
> 11     INPUT      jmolCmd0
> 12     INPUT
> 13     BR
> 14     INPUT      msg
> 15    (error)
>


These are just the elements of your page. These days, we use the ID field
for addressing specific elements. the NAME field is also useful in that it
groups radio buttons. (Can't think of anything else it is useful for.)



>
> So, for example, I can send commands with:
>
> WebBrowser1.Document.All(11).Value = "select  9 ; wireframe 80 ; color
> yellow ; spacefill 300"
> WebBrowser1.Document.All(12).Click
>

Certainly that is one way to do it. Still a hack, though.


>
> This seems good so far, but there are some obvious questions.
> 1)  Are the names and numbers (index) subject to change in future versions
> of Jmol ?
>

These names and numbers are just based on that particular web page you have
loaded. You get to decide what you have there.

2)  Is this the best way to go ?
>

I think so.


> 3)  What name or index are to be used to obtain state information? For
> turning the spin on and off, it would help to know its current state.
>

Yes, hmm. I think you will have to have a JavaScript function on the page
that runs jmolEvaluate and then returns a value to VB

>
> In conclusion, these first results are encouraging, but it was done
> somewhat blindly.
> To be continued.
>
> Michael Marden
> INSERM U779
> Hopital de Bicetre / Bat. Broca, Niveau 3
> University Paris 11
> 78 rue du General Leclerc
> 94275 Le Kremlin-Bicetre / France
> Tel: (Int. code + 33 1) 49 59 56 63  Fax: -61
> E-mail: michael.mar...@inserm.fr
>
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to