LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Boiler Plateing text into another text document.

I am trying to import the content of a ".txt" file into a formatted
web page. I seem to have a good grasp on the writeing part but not the
reading (importing) part.

The following is where I am at at the moment:

Public Sub importBoilerPlate()
Dim i As Long
Dim streng As String
On Error GoTo err_handler
ActiveWorkbook.Save
'================================================= ==================
Myfile = "H:\Tam\importBoPl.htm"
Open Myfile For Output As #1
Print #1, "<html<body<center<h2Heading</h2"
Print #1, "Standard generated text - not imported "
Print #1, "<table<tr<td"
MyBoilerPlate = "H:\Tam\testText.txt"
Open MyBoilerPlate For Output As #2
i = 0
Do While Not EOF(1)
Line Input #2, streng {I suspect my problem lays on this line}
i = i + 1
Loop
Close #2
Print #1, "</td</tr<tr<td"
Print #1, "Saturday 12th September 0942hrs"
Print #1, "</td</tr</table</center</body</html"
Close #1
'================================================= ====================
Exit Sub
err_handler:
MsgBox Err.Number & vbCrLf & Err.Description
End Sub


This is what is produced:

<html<body<center<h2Heading</h2
Standard generated text - not imported
<table<tr<td
{Note: The imported text should appear in here.}
</td</tr<tr<td
Saturday 12th September 0942hrs
</td</tr</table</center</body</html

Your comments, suggestions and assistance would be greatly
appreciated.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically move text from one document to another BB Excel Worksheet Functions 1 September 22nd 09 07:02 PM
creating text document AJB Excel Discussion (Misc queries) 3 October 30th 08 03:27 PM
Find repeated text in a text document in Excel JE Excel Worksheet Functions 2 June 8th 08 09:32 PM
text disappears from document to excel gregp22 New Users to Excel 1 March 20th 06 04:51 PM
Replace text in an XML document [email protected] Excel Programming 0 May 16th 05 10:38 PM


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"