Consulting

Results 1 to 2 of 2

Thread: Internet automation specific 'tinymce' textfield

  1. #1
    VBAX Regular
    Joined
    Nov 2017
    Posts
    10
    Location

    Post Internet automation specific 'tinymce' textfield

    Hi,

    I'm trying to populate one of 5 identical-looking text fields on a webpage; it looks like this:

    GqIwAmM.png

    Using Chrome's element inspector I've determined the associated code to be:
    (Green is the iframe and pruple is the 'tinymce' text field element)

    auUsXY8.jpg

    All the textfields on the page are within their own iframe;
    each iframe has a unique id, all the textfields have the same id (tinymce) but a unique data-id parameter.

    This is the code I'm using (I've removed the part where I log-in to get to this text field):

    'Declare
    Dim IE AsObject
    
    'Open Internet and navigate
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible =True
    IE.navigate "https://beheer.ingoedebanen.nl/10"
    'Code to wait for the page to load (Format Tags kept messing it up)
    
    'Populate text field
    IE.Document.parentWindow.execScript "tinyMCE.activeEditor.setContent('" & "It worked!" & "');", "javaScript"
    The text: 'It Worked!' did show up in one of the text fields on the webpage, just not the one I wanted.
    I realise I've never specified what textfield I want to populate in the code, but I'm clueless as to how I would do this.
    I did find "
    doc.frames("iframename")" online, which allows differentiating between iframes;
    But the only thing that's different across all these iframes is the id, and I don't see a name attribute.

    All help is greatly appreciated!
    - Jeremy

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Moderator Bump

    IIRC, all IE elements have a unique id, so you should be able to access : maybe IE.Elements(id#)
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •