Results 1 to 4 of 4

Thread: Two big problems!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Two big problems!

    I have merged from vb6 to vb.net and I have two problems I haven't yet found a solution to... here they come:

    1) How do I do ShellExecute() in vb.net? This is crucial to one of my deployed apps as well as future development...

    2) How do I change the default printer in vb.net? For this I also have a working solution.


    kind regards
    Henrik

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    1. ShellExecute: You can still you Shell function in VB.NET, however you may use process instead:
    VB Code:
    1. Dim pr As New Process(), s As String
    2. Try
    3.     s = "C:\myapp.exe"
    4.     pr.Start(s)
    5. Catch ex As System.Exception
    6.     MessageBox.Show(ex.Message)
    7. End Try

    2. Do you mean changing the default printer of Windows or the default printer that your application will use?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    Can you please show an example how to print by using vb.net instead of shellexecute-print? I want to pass a pdf and print it by using acrobat reader (e.g. the registered COM app with .pdf files)

    it is the default printer in windows.. this is easy to change in vb6...

    kind regards
    Henrik

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdrawingprintingprintdocumentclasstopic.htm

    this is the address in MSDN Documentation which shows you how to print a file .

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