Results 1 to 6 of 6

Thread: Print HTML file using ShellExecute

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Arrow Print HTML file using ShellExecute

    ShellExecute is supposed to print any file if the parameter passed is "print", it works on other files but I cannot get it work with HTML files, have you guys any workaround for this or am I missing something?

    TIA
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Print HTML file using ShellExecute

    Can we see the code?


  3. #3

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Print HTML file using ShellExecute

    My basis...

    Code:
    retval = ShellExecute(Form1.hWnd, "print", "C:\Project\picture.bmp", "", "C:\Project\", _
    		SW_MINIMIZE)
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: Print HTML file using ShellExecute

    Quote Originally Posted by dee-u
    My basis...

    Code:
    retval = ShellExecute(Form1.hWnd, "print", "C:\Project\picture.bmp", "", "C:\Project\", _
    		SW_MINIMIZE)
    VB Code:
    1. lngRetVal = ShellExecute(Me.hwnd, "Print", App.Path & "\Web.html", vbNullString, _
    2.                                 vbNullString, vbMinimized)

    This works for me . You do not need to pass a value to lpDirectory parameter if you have used the full directory in the lpFile parameter.
    Last edited by Jenova; Mar 18th, 2007 at 07:16 AM.

  5. #5
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Print HTML file using ShellExecute

    Gee... looks fine to me.

    Here is the MSDN on it. Maybe you see something different.

    http://msdn.microsoft.com/archive/de...n_shelexec.asp


  6. #6

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Print HTML file using ShellExecute

    Quote Originally Posted by Jenova
    VB Code:
    1. lngRetVal = ShellExecute(Me.hwnd, "Print", App.Path & "\Web.html", vbNullString, _
    2.                                 vbNullString, vbMinimized)

    This works for me . You do not need to pass a value to lpDirectory parameter if you have used the full directory in the lpFile parameter.
    Hmmm... Maybe the directory parameter makes the difference, thanks guys, will check it out later...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width