+ Reply to Thread
Results 1 to 2 of 2

Have the text which appears on a WebPage like Save As, Type Text with IE not HTML code?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-10-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Have the text which appears on a WebPage like Save As, Type Text with IE not HTML code?

    Hi,

    Is it possible to have the text which appears on a WebPage like Save As, Type Text with IE but no HTML code?

    thanks

    Regis

  2. #2
    Registered User
    Join Date
    02-10-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: Have the text which appears on a WebPage like Save As, Type Text with IE not HTML code

    I have found this code and adapted to my needs and it works:

    Sub Automate_IE_Enter_Data()
    
        Dim i As Long
        Dim URL As String
        Dim IE As Object
        Dim objElement As Object
        Dim objCollection As Object
        Dim HWNDSrc As Long
        Dim fso As Scripting.FileSystemObject
        Dim tsTxtFile As Object
        
        Set fso = New FileSystemObject
        Set fso = New Scripting.FileSystemObject
        
        Set IE = CreateObject("InternetExplorer.Application")
    
        IE.Visible = True
     
        URL = "Enter the url you needs here"
    
        IE.Navigate URL
     
        Do While IE.ReadyState = 4: DoEvents: Loop
    
        HWNDSrc = IE.HWND
    
        SetForegroundWindow HWNDSrc
    
        For Each itm In IE.document.all
            If itm = "[object HTMLInputElement]" Then
                itm.Value = "Title of the IE Window"
                itm.Focus 
    			
                Application.SendKeys "^s", True
                Application.Wait (Now + TimeValue("0:00:2"))
                
                Application.SendKeys "D:\web_page.txt", True
                Application.Wait (Now + TimeValue("0:00:2"))
    
                Application.SendKeys "{TAB}", True
                Application.Wait (Now + TimeValue("0:00:2"))
    
                Application.SendKeys "{DOWN}{DOWN}{DOWN}{DOWN}", True
                Application.Wait (Now + TimeValue("0:00:2"))
                
                Application.SendKeys "%E", True
                Application.Wait (Now + TimeValue("0:00:5"))
                
                Application.SendKeys "%O", True
                Application.Wait (Now + TimeValue("0:00:5"))
    
                GoTo endmacro
            End If
        Next
    
    endmacro:
        Set IE = Nothing
        Set objElement = Nothing
        Set objCollection = Nothing
        
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Storing complex text string into variable. Text string contains html or xml code.
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2015, 04:54 AM
  2. How to extract & save all text with similar html tags - imacros
    By faizzsheikh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2015, 04:18 AM
  3. Help in getting to full HTML source code for webpage via Excel VBA
    By stuht in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 05:41 PM
  4. Save cell contents to .HTML & .RTF text file
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2010, 11:30 PM
  5. Can I Save an Excel spread sheet as html text
    By Joe Miller in forum Excel General
    Replies: 2
    Last Post: 01-07-2006, 12:57 PM
  6. Can I Save an Excel spread sheet as html text?
    By Joe Miller in forum Excel General
    Replies: 4
    Last Post: 01-02-2006, 06:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1