Print file from VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DPK
    New Member
    • Sep 2006
    • 16

    Print file from VB

    Hi Friends !

    I have a file named "File.xls".
    I have to give it for printing through the VB.
    So can someone give me Idea or a brief of source..


    Thanks for any suggestion !!!
  • shaiful
    New Member
    • Oct 2007
    • 89

    #2
    yes you can try this code under your any command button

    [CODE=vb]Dim WD As Object
    Set WD = CreateObject("W ord.Application ")
    WD.Documents.Op en ("C:\shaiful.do c")
    WD.ActiveDocume nt.PrintOut Background:=Fal se
    WD.ActiveDocume nt.Close
    WD.Quit
    Set WD = Nothing[/CODE]
    Hope it will work, Cheers!
    Shaiful
    Software Engineer
    Last edited by Killer42; Oct 4 '07, 09:12 AM. Reason: Remove e-mail address as per site guidelines

    Comment

    Working...