Source language: Translate to:

Print to a disk File

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Print to a disk File

Postby CDP » Fri Aug 28, 2009 11:54 am

Currently I have a publication running off of a MDB file. I am able to take the fields from the database and do a merge with a rtf file with no problem (using TextWindow). This prints with no problem (using PrintTextFile). Is there a way to print this merged file to a disk file instead of to the printer without having to add a print driver? ExtractFile does not work as it produces a file with the database field placeholders, not the data from the database file.

Thanks in advanced,

Mike
Last edited by CDP on Tue Sep 08, 2009 6:39 pm, edited 1 time in total.
CDP
 
Posts: 2
Joined: Thu Aug 27, 2009 9:03 pm
Location: USA

Postby Neosoft Support » Sat Aug 29, 2009 3:39 pm

I think what you need to do is load the RTF file into a variable. Then use the StringReplace action to manually replace all of the database field placeholders with the actual data. For example:

Code: Select all
FileToVar "[PubDir]SourceFile.rtf" "[DocData]"

StrReplace "[DocData]" "[#91]MyDb.Table.Field1[#93]" "[MyDB.Table.Field1]" "[DocData]" ""
StrReplace...
StrReplace...
StrReplace...
...

FileWrite "[PubDir]NewFile.rtf" "All" "[DocData]"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby CDP » Tue Sep 08, 2009 6:38 pm

Thanks so much. That did the trick!
CDP
 
Posts: 2
Joined: Thu Aug 27, 2009 9:03 pm
Location: USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron