The quick answer to this is yes.
It may not be very stable as I have this process in a few of my clients offices.
1. Create the word document containing the lables
2. Save it as .rtf
3. Open the rtf in notepad or similar. You can now see the raw code that builds the rtf
The important commands you are looking for are:
\par (new line)
\page (new page)
Now what you need to do is create the rtf using the FSO command so that you create it on the fly whilst embedding your data into it.
Once the file is built you can then send the file to the browser (not very stable, although it does work) or email the document using an appropiate email object (CDO, ASPemail etc)
Finally I have included the fso command that takes the original RTF and builds a new file (new.txt) that contains the FSO command for each line of the file, therefore you don't have to insert the command by hand.
' the rft containing the labels
varfile = "1.rtf"
' the file that you are about to build
newfile = "new.txt"
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFS.OpenTextFile(Server.MapPath(varfile), 1)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(Server.MapPath(newfile))
' create the new text file
While Not objTS.AtEndOfStream
objTextFile.WriteLine "MyFile.WriteLine """ & Replace(objTS.ReadLine, """", """") & """"
Wend
Set objFSO = Nothing
Set objTextFile = Nothing
Set objTS = Nothing
Set objFS = Nothing
I am trying to find a better way of reporting through a browser that is either cheap / free and stable. I am currently looking at creating access reports on fly via asp. See my topic titled "Pass value into Access Report"
HTH !
|