<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: проверка электронной почты]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5214&amp;type=atom" />
	<updated>2010-11-26T11:10:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5214</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: проверка электронной почты]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42251#p42251" />
			<content type="html"><![CDATA[<p><strong>amgmail</strong>, под IE6 работает ровно как и заявлено. У Вас какая версия IE?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2010-11-26T11:10:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42251#p42251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: проверка электронной почты]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42250#p42250" />
			<content type="html"><![CDATA[<p>Ага, дошло. Окно будет открываться если уже открыто другое окно IE. И это видимо уже никак не исправить.</p>]]></content>
			<author>
				<name><![CDATA[amgmail]]></name>
			</author>
			<updated>2010-11-26T10:51:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42250#p42250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: проверка электронной почты]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42248#p42248" />
			<content type="html"><![CDATA[<p>Взял с форума скрипт проверки почты. При начале работы открывается окно InternetExplorer, далее осуществляется вход. А нельзя чтобы проверка осуществлялась в скрытом режиме, т.е. чтобы не открывалось окно InternetExplorer, и разве не для этого определяется свойство Visible = False, а если для этого, почему у меня оно не работает?</p><div class="codebox"><pre><code>Option Explicit
Dim objIE
Dim objForm
Dim collLinks
Dim objLink
Dim strNewMessagesCount
Dim lngNewMessagesCount

Set objIE = WScript.CreateObject(&quot;InternetExplorer.Application&quot;)

With objIE
    .Visible = False
    .Navigate &quot;http://win.mail.ru/&quot;
    
    Do 
        WScript.Sleep 100
    Loop While .Busy
    
    Set objForm = .Document.forms(&quot;Auth&quot;)
    
    With objForm
        .elements(&quot;Login&quot;).value = &quot;login&quot;
        .elements(&quot;Domain&quot;).value = &quot;mail.ru&quot;
        .elements(&quot;Password&quot;).value = &quot;pass&quot;
        
        .submit()
    End With
    
    Do
        WScript.Sleep 100
    Loop While .Busy
    
    Set collLinks = objIE.document.getElementsByTagName(&quot;A&quot;)
    
    For Each objLink In collLinks
        If objLink.innerText = &quot;Входящие&quot; Then
            strNewMessagesCount = objLink.parentNode.nextSibling.innerText
            
            If IsNumeric(Trim(strNewMessagesCount)) Then
                lngNewMessagesCount = CLng(strNewMessagesCount)
            Else
                lngNewMessagesCount = 0
            End If
            
            If lngNewMessagesCount &lt;&gt; 0 Then
                If MsgBox(&quot;Есть новые сообщения в папке Входящие: &quot; &amp; CStr(lngNewMessagesCount) &amp; &quot; шт.&quot; &amp; vbCrLf &amp; _
                    vbCrLf &amp; _
                    &quot;Показать новые сообщения из папки Входящие в окне Internet Explorer?&quot;, _
                    vbYesNo + vbInformation + vbDefaultButton1 + vbSystemModal, _
                    &quot;Есть новые сообщения&quot;) = vbYes Then
                    
                    objLink.click
                    
                    Do 
                        WScript.Sleep 100
                    Loop While .Busy
                    
                    .Visible = True
                End If
            End If
            
            Exit For
        End If
    Next
End With

If Not objIE.Visible Then
    Set objIE = Nothing
End If

WScript.Quit 0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[amgmail]]></name>
			</author>
			<updated>2010-11-26T10:39:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42248#p42248</id>
		</entry>
</feed>
