Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regular text + word doc into HTML
Message
De
22/04/2005 09:07:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Regular text + word doc into HTML
Divers
Thread ID:
01007424
Message ID:
01007424
Vues:
80
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform