Hi,
This code works after the we login to rediffmail.com webpage then I have clicked on new mail entered the details that is to, cc, subject.
Please login to rediffmail then click on Classic view (Old view I am using)
Please click on write new mail. then below code tries to attch the file for attchment but it falis.
!!!!!! Please please please help me.!!!!!!!!!!!
So following is the code that clicks on Attachment link.
Please note references added in below code are
Microsoft Internet Conrols
Micosoft HTML Object Library
Public objIE As InternetExplorer
Public objAIE As InternetExplorer
Public ElementCol As MSHTML.IHTMLElementCollection
Public btnInput As MSHTML.HTMLInputElement
Public link As MSHTML.HTMLAnchorElement
sub AutoRediff()
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
Set ElementCol = objIE.document.getElementsByTagName("a")
For Each link In ElementCol
If InStr(link.href, "javascript:attachment") Then
MsgBox link.href
link.Click
Exit For
End If
Next
' ********This code sets objAIE to the attchmemnt window.... So each 'control of attchment window I can access using objAIE *************
Set objShellWindows = objShell.Windows
For j = 0 To objShellWindows.Count - 1
Set objaie = objShellWindows.Item(j)
If InStr(objaie.LocationURL, "http://f5mail.rediff.com/bn/wupload.cgi") Then
'********** This code I am using to set the file selector value. That is 'attchment. But it is not working. *****************************
Set ElementCol = objAIE.document.getElementsByTagName("INPUT")
For Each btnInput In ElementCol
Debug.Print btnInput.Name
If btnInput.Name = "upfile1" Then
btnInput.Value = "C:\New Folder\B.xls"
' objaie.document.form(0).Filename.Value = "C:\New Folder\B.xls"
End If
Next
End if
'******** This code clicks on attch button.**************
Set ElementCol = objAIE.Document.getElementsByTagName("input")
For Each link1 In ElementCol
If link1.Name = "attach" Then
link1.Click
End If
Next
'**************************************************
End Sub
Here I am not able to input the value please can anyone help me with this. It will really appreciable as i am tring to do this since last 2 days.
Please help me.
Thanks in advance.
Thanks,
Ganesh.
This code works after the we login to rediffmail.com webpage then I have clicked on new mail entered the details that is to, cc, subject.
Please login to rediffmail then click on Classic view (Old view I am using)
Please click on write new mail. then below code tries to attch the file for attchment but it falis.
!!!!!! Please please please help me.!!!!!!!!!!!
So following is the code that clicks on Attachment link.
Please note references added in below code are
Microsoft Internet Conrols
Micosoft HTML Object Library
Public objIE As InternetExplorer
Public objAIE As InternetExplorer
Public ElementCol As MSHTML.IHTMLElementCollection
Public btnInput As MSHTML.HTMLInputElement
Public link As MSHTML.HTMLAnchorElement
sub AutoRediff()
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
Set ElementCol = objIE.document.getElementsByTagName("a")
For Each link In ElementCol
If InStr(link.href, "javascript:attachment") Then
MsgBox link.href
link.Click
Exit For
End If
Next
' ********This code sets objAIE to the attchmemnt window.... So each 'control of attchment window I can access using objAIE *************
Set objShellWindows = objShell.Windows
For j = 0 To objShellWindows.Count - 1
Set objaie = objShellWindows.Item(j)
If InStr(objaie.LocationURL, "http://f5mail.rediff.com/bn/wupload.cgi") Then
'********** This code I am using to set the file selector value. That is 'attchment. But it is not working. *****************************
Set ElementCol = objAIE.document.getElementsByTagName("INPUT")
For Each btnInput In ElementCol
Debug.Print btnInput.Name
If btnInput.Name = "upfile1" Then
btnInput.Value = "C:\New Folder\B.xls"
' objaie.document.form(0).Filename.Value = "C:\New Folder\B.xls"
End If
Next
End if
'******** This code clicks on attch button.**************
Set ElementCol = objAIE.Document.getElementsByTagName("input")
For Each link1 In ElementCol
If link1.Name = "attach" Then
link1.Click
End If
Next
'**************************************************
End Sub
Here I am not able to input the value please can anyone help me with this. It will really appreciable as i am tring to do this since last 2 days.
Please help me.
Thanks in advance.
Thanks,
Ganesh.