Groups > Superbase > Superbase 3 programming > Re: Automatic WORDDOC Print




Re: Automatic WORDDOC Print

Re: Automatic WORDDOC Print
Fri, 02 Feb 2007 07:15:14 -050
There are different ways to control Word and Excel, etc. using AutoObject (look
in Help) or as below, GETOBJECT, Superbase OLE functions:

  ' this opens a specific workbook and formats it for display

      DIM s AS object
      'SET s = Servers.Add("excel.application")
      SET s = GETOBJECT (dfil$)
      s.application.Visible = - 1' Make Excel Visible
      s.application.Windows( FN NAME (dfil$)).Visible = - 1' +
".xls").Visible = - 1
  '     s.application.Windowstate = - 4137' Maximized
      s.activesheet.Cells.Select()'Range("A1:G1").Select()
      s.application.Selection.Font.Name = "Arial"
      s.application.Selection.Font.Size = 8
      s.application.Selection.Font.Strikethrough = 0
      s.application.Selection.Font.Superscript = 0
      s.application.Selection.Font.Subscript = 0
      s.application.Selection.Font.OutlineFont = 0
      s.application.Selection.Font.Shadow = 0
      s.application.Selection.Columns.AutoFit()
      s.application.Columns("A:J").Select()
      s.application.Selection.NumberFormat = "#,##0.0000"
      s.application.Range("A1").Select()
      s.application.workbooks(1).saved = - 1


I'm sure you can controll Word from Superbase in the same way.


Hope this is useful

Peter







On Fri, 02 Feb 2007 06:17:26 -0500, Andreas Knoblauch
<Andreas.Knoblauch@icem.com> wrote:

> Hallo,
>
> i do it calling the Execution Routine from the OS, that starts the
> appropriate program (if installed properly).
>
> Here my code, beware of line warps.
> Just call ExDatei_drucken("xxx.doc") and it should do the work.
>
> Hope that helps,
> Andreas K.
>
> SUB ExDatei_drucken(FileName$)
>   IF EXISTS (FileName$) THEN CALL
> Shell_Execute("print",FileName$,"",AktDir$,0)
>   END SUB
> SUB Shell_Execute(Operation$,FileName$,Parameter$,DefaultDir$,Modus%%)
>   'Operation$ = Shell operation (open, print etc.)
>   'Parameter$ = Command line parameter
>   'DefaultDir$ = directory where action starts
>   'Modus%% = 1 (start with normal WINDOW size)
>   DIM null%
>   Superbase.Error(168) = 0
>   REGISTER "Shell","ShellExecute","JJCCCCI"
>   Superbase.Error(168) = - 1
>   null% = CALL
>
("ShellExecute",0,Operation$,FileName$,Parameter$,DefaultDir$,Modus%%)

>   REGISTER CLEAR "ShellExecute"
>   END SUB
>
>
> JVSchmidt schrieb:
>> Hi everybody,
>> what I want is to print a special document with  MS Word
>> and close MS Word after printing is done.
>> How can I do this from inside a SB program?
>> Could it be done with an EXECUTE statement?
>>
>> JVS
>>
>>
>
Post Reply
Automatic WORDDOC Print
Fri, 2 Feb 2007 10:03:45 +0100
Hi everybody,
what I want is to print a special document with  MS Word
and close MS Word after printing is done.
How can I do this from inside a SB program?
Could it be done with an EXECUTE statement?

JVS

Post Reply
Re: Automatic WORDDOC Print
Fri, 02 Feb 2007 12:17:26 +010
Hallo,

i do it calling the Execution Routine from the OS, that starts the 
appropriate program (if installed properly).

Here my code, beware of line warps.
Just call ExDatei_drucken("xxx.doc") and it should do the work.

Hope that helps,
Andreas K.

SUB ExDatei_drucken(FileName$)
  IF EXISTS (FileName$) THEN CALL 
Shell_Execute("print",FileName$,"",AktDir$,0)
  END SUB
SUB Shell_Execute(Operation$,FileName$,Parameter$,DefaultDir$,Modus%%)
  'Operation$ = Shell operation (open, print etc.)
  'Parameter$ = Command line parameter
  'DefaultDir$ = directory where action starts
  'Modus%% = 1 (start with normal WINDOW size)
  DIM null%
  Superbase.Error(168) = 0
  REGISTER "Shell","ShellExecute","JJCCCCI"
  Superbase.Error(168) = - 1
  null% = CALL 
("ShellExecute",0,Operation$,FileName$,Parameter$,DefaultDir$,Modus%%)

  REGISTER CLEAR "ShellExecute"
  END SUB


JVSchmidt schrieb:
> Hi everybody,
> what I want is to print a special document with  MS Word
> and close MS Word after printing is done.
> How can I do this from inside a SB program?
> Could it be done with an EXECUTE statement?
> 
> JVS
> 
Post Reply
about | contact