Re: Combine separate HTML documents into one

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks Rafael. My forte is really VBA, I'm not that familiar with script.
I will put your solution to the test.

Thanks.

"Rafael T" wrote:

> Quartz,
>
> I made one quite fast, but it doesn't take into consideration the html tags
> inside each document. What I mean is that your final page will have as many
> <body> tags as documents it combines.
> IE will have no problems open it, but other browsers might.
>
> hope this helps,
> Rafael
>
>
> Option explicit
> dim objDialog
> dim srcFileName
> dim intResult
> dim objFS
> dim tgtFileName, openFile
> dim listFile
> dim content
> dim numFiles
> dim i
>
> Set objDialog = CreateObject("UserAccounts.CommonDialog")
> i=1
> numFiles=inputbox ("Please enter number of files to process")
>
> do while i<=int(numFiles)
>
> objDialog.Filter = "All Files|*.*"
> objDialog.InitialDir = "C:\"
> intResult = objDialog.ShowOpen
>
> If intResult = 0 Then
> Wscript.Quit
> Else
> srcFileName= objDialog.FileName
> End If
>
> set objFS=CreateObject ("Scripting.FileSystemObject")
>
> set listFile = objFS.OpenTextFile (srcFileName)
> do while listFile.AtEndOfStream <> True
> content= content + vbcrlf + listFile.ReadLine
> Loop
> 'Wscript.Echo content
> i=i+1
> loop
>
> tgtFileName= InputBox("Enter Target Path & FileName","Target")
>
>
> Set openFile = objFS.OpenTextFile(tgtFileName, 2, "True")
> openFile.writeline content
>
> openFile.close
>
> msgbox "DONE"
> set objFS=nothing
> set objDialog=nothing
>
>
>
> "Nic Roche" <nicroche@xxxxxxxxxxx> wrote in message
> news:ONGzAliRFHA.2252@xxxxxxxxxxxxxxxxxxxxxxx
> >> Therefore, I need to combine these separate HTML documents into a single
> >> HTML document using either VBA or VBScript. I want to arrange the pages
> >> one
> >> above the other into a single document.
> >
> > If ASP (this is INETSDK group) then
> >
> > <!--#include file="excel_out1.htm"-->
> > <!--#include file="excel_out2.htm"-->
> > <!--#include file="excel_out3.htm"-->
> >
> >
> > Nic Roche
> >
> > "quartz" <quartz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:31F8F2D6-9BA7-4552-AFF0-B4A7B41D4025@xxxxxxxxxxxxxxxx
> >>I am using Excel 2003 on Windows XP.
> >>
> >> I receive 3 to 5 Excel files from different sources that have been
> >> converted
> >> to HTML already. For various reasons, these files cannot be (easily)
> >> combined
> >> in Excel.
> >>
> >> Therefore, I need to combine these separate HTML documents into a single
> >> HTML document using either VBA or VBScript. I want to arrange the pages
> >> one
> >> above the other into a single document.
> >>
> >> 1. Is this possible using VBA or VBScript?
> >>
> >> 2. Could someone please post example code to accomplish this task?
> >>
> >> Thanks much in advance.
> >
> >
>
>
>
.



Relevant Pages

  • Re: Finding and Replacing a Certain Word from 100+ Documents
    ... I have never read a book on VBA. ... Word MVP web site http://word.mvps.org ... Dim FirstLoop As Boolean ...
    (microsoft.public.word.vba.general)
  • Re: SumProduct, Match in a UDF
    ... dim vData as variant ... I definitely need help w/ arrays & VBA, ... All these named ranges will always be available for formula, ... UDF parameter list. ...
    (microsoft.public.excel.programming)
  • Re: Request help with a custom date field - ? 4 Greg...
    ... Greg Maxey wrote: ... But, when I pasted the DateAddUp code in VBA, one line of code was ... Dim oFF As Word.FormFields ... calculations later in the form, such as with the code you've ...
    (microsoft.public.word.vba.beginners)
  • RE: To prompt us to copy from
    ... directly from VBA without having to shell a cmd line. ... Dim sDest As String ... 'Make sure the \ is between the folder and filename ...
    (microsoft.public.access.modulesdaovba)
  • RE: To prompt us to copy from
    ... directly from VBA without having to shell a cmd line. ... Dim sDest As String ... 'Make sure the \ is between the folder and filename ...
    (microsoft.public.access.modulesdaovba)