Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-14-2014, 05:53 AM
elmnas elmnas is offline Copy webcontent to a document Windows 7 64bit Copy webcontent to a document Office 2010 64bit
Novice
Copy webcontent to a document
 
Join Date: Jul 2014
Posts: 6
elmnas is on a distinguished road
Default Copy webcontent to a document

Hello all VBA Members

I am trying to auotmate a process of word

I get lots of different wordjobs, they always have a job number, for example 741443
we have a webpage where we can see all active jobs, as we see both job numbers (741443)


and also an EP-number (E7295_EP2586715)

I want to copy this part of the EP-number (EP2586715) to a word document.

the word document is always in the folder called 741443.

my problem is, when there are several different jobs with different EP-numbers,
the macro need to copy the correct EP-Code from the webpage to the document.

here is a picture

how it looks like

Attachment 116359



Do have someone a solution for this?


here is a sample I did,
but the pastemethod doesn't work


HTML Code:
Sub CopyWebContent()
 
    
Dim IE As Object
Dim rng1 As Range
Dim thisdoc As Document
Dim newdoc As Document
Dim st
Set thisdoc = ActiveDocument
Set newdoc = Documents.Add
Documents(thisdoc).Activate
           
 
    
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
        .Visible = True
        .navigate "tsq/"
        Do Until .ReadyState = 4: DoEvents:  Loop
        End With
        IE.ExecWB 17, 0 '// SelectAll
        IE.ExecWB 12, 2 '// Copy selection
     
   
               Selection.Paste
 
    
   
       Set rng1 = Selection.Range
 
       '  IE.Quit
        
    End Sub

Thank you in advance all VBA Members

Cheers!

Daniel
Reply With Quote
  #2  
Old 07-15-2014, 10:08 PM
macropod's Avatar
macropod macropod is offline Copy webcontent to a document Windows 7 32bit Copy webcontent to a document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://www.vbaexpress.com/forum/show...-to-a-document
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

I note you have previously been asked to provide cross-post links (e.g. https://www.msofficeforums.com/word-...directory.html). Please don't make a habit of ignoring such basic courtesies. Those who do soon find their posts being ignored and, on some forums, being banned.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
copy content, copy page, copy web



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy webcontent to a document Copy Toolbar Icons into tutorial document GreenBoy Word 2 06-22-2014 12:12 PM
Copy table to another location in the same document Sektor Word VBA 2 03-31-2014 09:28 PM
Anyway to copy a complete page full of objects into a new document? MuffinStud Word 1 12-20-2012 04:43 AM
Copy webcontent to a document Copy only Tables of a Document Loretti Word 1 11-12-2012 03:35 PM
Copy webcontent to a document Copy from one word document to another no identical gmurphy Word 3 09-07-2011 04:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft