doesn't anyone here know IE controls?

  • Thread starter Thread starter thomas donino
  • Start date Start date
T

thomas donino

I have posted this on so many boards I am shocked that noone has an answer.
I have a macro running in excel 2007 that opens many pdf's from different
webpages and saves them. I have no problem navigating around IE through vba,
BUT how can I control printing via the IE window when a pdf is opened INSIDE
the IE window. I would be happy to post a screenshot of the window a) if
thats allowed and b) if someone describes how to do so.

Help!!

thank you
 
Sendkey is to unreliable. There must be IE controls that allow selecting and
manipulating printers
 
Sorry p45cal, I was in transit to the office

The code is below, less the real user pass, and i ended it at the point
where it brings the pdf up in IE

Sub AutomateMornTasks()

Dim ie As InternetExplorer
Dim RegEx As RegExp, RegMatch As MatchCollection
Dim strMainPathdfj As String
Dim strFiletoFind As String
Dim strMainPathstu As String

Dim strDatePart As String
Dim PrinterToUse As String
Dim strNetworkPrinter As String
Dim ipf As Object
Dim Username As String
Dim password As String
Dim my_var As String
Username = "xxxx"
password = "xxxx"


Set ie = New InternetExplorer
Set RegEx = New RegExp
strMainPathdfj = "http://www.elliottwave.com/dfj/archives/"
strMainPathstu = "http://www.elliottwave.com/stu/archives/"

'open Internet Explorer, navigate to Ewave site
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "www.elliottwave.com/"
Do While .ReadyState <> 4 Or _
.Busy = True
Loop
'check to see if I am already logged in, if not then log in
my_var = .Document.body.innerhtml
If InStr(1, my_var, "Please Login", vbTextCompare) > 0 Then
Set ipf = .Document.getElementById( _
"ewiHeader_ucEwiLogin_userid")
ipf.Value = Username

Set ipf = .Document.getElementById( _
"ewiHeader_ucEwiLogin_password")
ipf.Value = password

Set ipf = .Document.all.Item("id")

Set ipf = .Document.getElementById( _
"ewiHeader_ucEwiLogin_ibGo")
ipf.Select
ipf.Click
End If
End With
'create string for filename
If Weekday(Date) = 1 Then
strDatePart = Replace(Format(Date - 2, "mmdd"), "/", "")
strFiletoFind = strMainPathdfj & strDatePart & "dfjww" & ".pdf"
Else
If Weekday(Date) = 7 Then
strDatePart = Replace(Format(Date - 1, "mmdd"), "/", "")
strFiletoFind = strMainPathdfj & strDatePart & "dfjww" & ".pdf"
Else
strDatePart = Replace(Format(Date, "mmdd"), "/", "")
strFiletoFind = strMainPathdfj & strDatePart & "dfj" & ".pdf"
End If
End If
With ie
..Visible = True
..Navigate2 strFiletoFind
end with
end sub
 
Open a pdf that opens in explorer from any website. its the same thesis, a
pdf thats open in explorer. I perused the site in question but i dont see any
free pdf's to download.
 
Back
Top