Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regular text + word doc into HTML
Message
From
22/04/2005 09:07:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Regular text + word doc into HTML
Miscellaneous
Thread ID:
01007424
Message ID:
01007424
Views:
81
Hi,
I have an application where we have regular text (memo field) and letters in .doc format intersperced. They need to be combined into HTML so they can be shown (and printed) together.
Does anyone have a good way of doing this.

It will be displayed in a browser object.
Here is what I do now but I would like to have some better code:
			lchtml=[<html><body><table>]
			SELECT ccprint
			SCAN FOR docType="FILENOTE" OR docType="LETTER"
				DO CASE
					CASE docType="FILENOTE"
						TEXT TO lcHTML NOSHOW TEXTMERGE ADDITIVE
							<tr><<ccprint.notes>></tr>
						ENDTEXT
					CASE docType="LETTER"
						***
						lcDocName=ADDBS(SYS(5)+SYS(2003))+"DocDir\WordDocs\"+ALLTRIM(ccprint.docpath)+".doc"
						IF FILE(lcDocName)
							THISFORM.oWord.visible=.f.
							THISFORM.oWord.documents.OPEN(lcDocName,,.T.)

							xNt=THISFORM.oWord.ActiveDocument.Content.TEXT
							THISFORM.oWord.documents.CLOSE()
							*xNt=ALLTR(xNt,CHR(13)+CHR(10))
							xNt=STRTRAN(xNt,CHR(13),[<br>])

							TEXT TO lcHTML NOSHOW TEXTMERGE ADDITIVE
							<tr><hr>
							<<xNt>>
							<hr></tr>
							ENDTEXT
						ENDIF
						****

					OTHERWISE

				ENDCASE
			ENDSCAN
			TEXT TO lcHTML NOSHOW TEXTMERGE ADDITIVE
				</table></body></html>
			ENDTEXT
			WITH THISFORM.oWB
				.NAVIGATE("about:blank")
				lnStartSeconds = SECONDS()
				DO WHILE .ReadyState <> 4 ;
						AND (SECONDS()-lnStartSeconds <= 1 )
					DOEVENTS
				ENDDO
				.DOCUMENT.OPEN()
				.DOCUMENT.WRITE(lchtml)
				.DOCUMENT.CLOSE()
				.VISIBLE=.T.
			ENDWITH
		ENDIF
Thanks for your input


Peter
Peter Cortiel
Next
Reply
Map
View

Click here to load this message in the networking platform