We help IT Professionals succeed at work.

Using VBA to View Source Code for HTML File Opened in IE

BVass
BVass asked
on
3,634 Views
Last Modified: 2018-08-07
Hi,

I am trying to get my VBA in Access to open a .htm file in IE and then save the source code so I can add it to the body of an email.

I can get IE to open and navigate to the file (see code snippet), but this is as far as I can get.

I need the code to be able to view / save the underlying HTML Code for this file.

Thanks,

BVass
Function IECode()
 
Dim ieApp as Object
 
    Set ieApp = CreateObject("internetexplorer.application")
    ieApp.navigate2 "file:///F:/Work/Mail%20Merge/BrokerageFee.htm"
    ieApp.Visible = True
 
End Function

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Chuck MorrisonIndependent Consultant (Healthcare)

Commented:
This code doesn't do anything.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.