I have a simple text box I need to fill in with my email which I have managed to do very simply with this code;
The layout looks like this with my email.value entered in.
I'm using Access 2007, but that is irrelevant for the VBA.
My problem is I can't enter the filename as easily. I have to use SENDKEYS to TAB over then a bunch of other tacky SENDKEY commands to load my file. Even though it works I don't feel it's reliable and would rather just fill the file name in a bit easier.
I used IE developer to show before and after using the BROWSE button to load the file location as seen in pic 1 and pic 2.
The code below has been my best attempt. It runs without error but it does not give me the result I need which is a file location for the application to pull.
Code:
Dim IE As InternetExplorer
Dim sIEWindowName As String
Set IE = New InternetExplorer
IE.Visible = True
sIEWindowName = "Some Webpage - Windows Internet Explorer"
IE.Navigate "[URL]http://somewebsite.iuse.com[/URL]"
'
Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop
IE.Document.form1.Email.Value = "[EMAIL="my.name@someisp.com"]my.name@someisp.com[/EMAIL]"
The layout looks like this with my email.value entered in.
I'm using Access 2007, but that is irrelevant for the VBA.
My problem is I can't enter the filename as easily. I have to use SENDKEYS to TAB over then a bunch of other tacky SENDKEY commands to load my file. Even though it works I don't feel it's reliable and would rather just fill the file name in a bit easier.
I used IE developer to show before and after using the BROWSE button to load the file location as seen in pic 1 and pic 2.
The code below has been my best attempt. It runs without error but it does not give me the result I need which is a file location for the application to pull.
Code:
IE.Document.form1.FileName.Value = "C:\New Folder\aFileToUpload.txt"