Normal Topic Capturing and emailing printstring documents (Read 991 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Capturing and emailing printstring documents
Dec 11th, 2007 at 7:13pm
Print Post Print Post  

I use mergefile print and @sendmail to create and E-mail many documents. This works well, however I have some incredible output files like invoices that were created using print string commands, but now have the need to capture these documents for future review or to use as attachments to emails.

Is there any method I can use to capture this output for review or attaching to emails? The only thing I come up with on my own is using alternatedefaltprinter( ) and printing to a pdf driver. My problem is I have not found one that gives me a method of passing the directory and filename without user intervention. Is there a command or technique I am overlooking or does anyone know of a pdf driver that uses an ini file for path and file name so I can use my sbasic file I/O commands to alter the  ini file each time I use it.

All thoughts are greatly appreciated.

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #1 - Dec 11th, 2007 at 8:24pm
Print Post Print Post  
I found a setting that allows me to tell the pdf driver to always print in the same directory.

I set it up to create the file in a directory c:\sesame\ct1\prntstrg

I am thinking that after the file is generated in that directory I should be able to rename it to my proper naming convention and move it immediately to a directory my application will use to retrieve it.

What would be a good way to do this?

??? On my command button after printing, run an  @asynchshell command that runs a batch file ??? or ??? help…
Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Capturing and emailing printstring documents
Reply #2 - Dec 11th, 2007 at 8:43pm
Print Post Print Post  
Hello Robert,

If you are e-mailing it using the same routine, then you'd probably want to use @Shell() rather than @ASynchShell() as you'll need the Sbasic to pause until the file is in the right place to be e-mailed.

The Move command can be used to both move the PDF and rename it. So if you know the name you can just @Shell the Move command and not have to worry about a batch file.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #3 - Dec 11th, 2007 at 10:02pm
Print Post Print Post  
Thanks for the help Ray.

I know the directory were the file is created and I know the name it is. I want to be able to name it the InvNo + “Img”. I can create a filename using sbasic variables but I am not sure how I can get the name to the move command. Any hints?


MOVE "c:\Sesame\CT1prntstrg\invoutput.pdf" "c:\sesame\ct1\invimg\VARIABLE NAME"

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Capturing and emailing printstring documents
Reply #4 - Dec 11th, 2007 at 10:17pm
Print Post Print Post  
Hello Robert

It would be something like...

Code
Select All
vSuccess = @Shell("MOVE " + @chr(34) + "c:\Sesame\CT1prntstrg\invoutput.pdf" + @chr(34) + " " + @chr(34) + "c:\sesame\ct1\invimg\" + VariableName + @chr(34)) 




-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #5 - Dec 11th, 2007 at 10:56pm
Print Post Print Post  
As always Ray thanks for all the help.  Smiley

AS a test I was just trying the move and rename part using this on a command button

var vSuccess as string
var VInvname as string

VInvname = "123inv.pdf"

vSuccess = @Shell("MOVE " + @chr(34) + "c:\Sesame\ctrak1\prntstrgout\ Sesame Document.pdf + @chr(34) + " " + @chr(34) + "c:\sesame\ctrak1\invimg\" + VInvname + @chr(34))

when I hit Sbasic test button I get

Symbol expected  ) symbol found string constant

Thoughts?
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #6 - Dec 11th, 2007 at 10:59pm
Print Post Print Post  
You're missing a double quote after pdf.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #7 - Dec 11th, 2007 at 11:05pm
Print Post Print Post  
You are quick and correct! Smiley (the quick part did not come out sounding the way I meant it  Wink)

It works awesome. Thanks, Thanks and more Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Capturing and emailing printstring documents
Reply #8 - Dec 12th, 2007 at 12:37am
Print Post Print Post  
For future reference, check out this free utility:

Using OmniFormat creates folders that automatically convert source files into PDF documents for anything sent to that folder.  Can use redirection, print file, drag/drop, image files, text files, Word Documents, etc..

Specifics at http://www.omniformat.com

Caution, original source file will be deleted after conversion.  Not a problem if you know about it.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Capturing and emailing printstring documents
Reply #9 - Dec 12th, 2007 at 6:53am
Print Post Print Post  
Thanks Bob!
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged