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
"p45cal" wrote:
Post the code you currently use for 'navigating around IE through vba'.
I'd be surprised if IE doesn't expose its objects.
What version of IE?
I had some trouble, but succeeded in the end, with establishing the
right printer to print pdf files to for any machine on a largish company
network, but it depended on which version of Acrobat was installed (and
some of the Adobe object maodel manuals were plain wrong).
I'd guess that you'd have to go through a similar (and simpler) process
with IE with a pdf in an IE window.
--
p45cal
*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=130328