UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> VBA To Copy Part Of A Web Page?, Internet Explorer 9    
 
   
EdNerd
post Jun 10 2014, 06:28 PM
Post#1



Posts: 774
Joined: 23-May 11



I'm using VBA through Word to try to copy a part of a web page. I can get the specific div of the web page in my code. But when I pull the text into the document, it's all completely unformatted.
'd like to see if there's any way I can copy this div in the web page as it's formatted. I know if I manually select it with the mouse and Copy, I can Paste and get all the formatting. Can I mimic this in VBA?
Ed
CODE
strCheck = "http://www.MyWebPage.com/"
Set objIE2 = GetIE(strCheck)
Set docIE = objIE2.Document
For x = 0 To docIE.getElementsByTagName("div").Length - 1
  Set objMyDiv = docIE.getElementsByTagName("div")(x)
  
  If Left(objMyDiv.ClassName, 16) = "passage version-" Then
    Stop
    Stop
    
    Exit For
    
  End If
Next x
Go to the top of the page
 
CyberCow
post Jun 17 2014, 05:37 PM
Post#2


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


See if this article is of any value.
hope this helps hat_tip.gif
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    14th December 2017 - 09:44 PM