Will an ActiveX control serve this purpose?

Discussion in 'ASP .Net' started by Shawn, Jun 22, 2005.

  1. Shawn

    Shawn Guest

    Hi.
    I've never created an ActiveX control before, so I know little about what it
    is capable of and what its limitations are. My problem is this: I have to
    create a way to send multiple documents from the web server to a printer on
    the user's network. The way it works today the user has to manually
    download each document and send it to his printer, but now they want me to
    create an automated process.
    Will I be able to download documents to the user's temp catalogue with an
    ActiveX control? If I can do that I can just send them to his default
    printer using ShellExecute.

    Need to know if this is possible before I start researching :)
    If anyone can provide me with a good tutorial that would be great!

    Thanks,
    Shawn
    Shawn, Jun 22, 2005
    #1
    1. Advertising

  2. Shawn

    bradley Guest

    An ActiveX control is basically a COM compenent, typically with GUI
    elements, that can be hosted by a container, such as a Windows Form or web
    page, and scripted. It is similar in concept to a Java applet, except that
    there are no restrictions about accessing the client's resources and file
    system. It is a full blown Win32 executable, but with the extention OCX. The
    clients browser security settings will need to be configured to allow this.
    I think that by default IT will allow, but displays a confirmation dialog
    before downloading the control.

    Below are some MSDN articles..

    HOW TO: Host ActiveX Controls in a Web Form
    http://support.microsoft.com/default.aspx?scid=kb;en-us;317392

    PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
    Applications in Visual Basic .NET
    http://support.microsoft.com/default.aspx?scid=kb;en-us;311300

    Visual Basic 6.0 is the best (most user friendly) tool for building ActiveX
    controls. The client will need to have the VB6 runtime installed on their
    PC, but Windows 2000/XP comes bundled with this.
    http://msdn.microsoft.com/library/d...s/vbcon98/html/vbconcreatingolecomponents.asp

    However, if it were me, I would first try to implement a solution that
    involved building WSH scripts dynamically on the server and then have the
    client click on an execute them. A few lines of VB Script is much more
    simple to program and maintain than delving into ActiveX control building,
    especially if you havn't built one before.

    http://msdn.microsoft.com/scripting

    You didn't say what type of documents you are wanting to print, so I'm
    assuming MS Word or Adobe PDF. You can find example script on the web for
    automating MS Word and perhaps Adobe using WSH.

    http://www.vandyke.com/support/crt/scripts/run_word_vbs.txt

    Just like ActiveX controls, the client's browser security settings will
    probably need modfying to execute .vbs or .js scripts from the web.

    If you get this working, then reply back to the group with details.


    "Shawn" <> wrote in message
    news:%...
    > Hi.
    > I've never created an ActiveX control before, so I know little about what

    it
    > is capable of and what its limitations are. My problem is this: I have to
    > create a way to send multiple documents from the web server to a printer

    on
    > the user's network. The way it works today the user has to manually
    > download each document and send it to his printer, but now they want me to
    > create an automated process.
    > Will I be able to download documents to the user's temp catalogue with an
    > ActiveX control? If I can do that I can just send them to his default
    > printer using ShellExecute.
    >
    > Need to know if this is possible before I start researching :)
    > If anyone can provide me with a good tutorial that would be great!
    >
    > Thanks,
    > Shawn
    >
    >
    bradley, Jun 22, 2005
    #2
    1. Advertising

  3. Shawn

    Shawn Guest

    Hi.
    Just letting you know that I solved my problem with the use of a WSH.
    Thanks for pointing me in the right direction bradley!

    Option Explicit
    '*
    Const cVBS = "savefile.vbs"
    Const cOUT = "C:\temp\"
    Const cURL = "http://www.google.no/intl/no_no/images/"
    Const cPAG = "logo.gif"
    '*

    Fetch cURL & cPAG,cOUT & cPAG
    Print cOUT & cPAG

    Function Fetch(xURL,xOUT)
    On Error Resume Next
    Err.Clear
    Dim b
    With CreateObject("Microsoft.XMLHTTP")
    .Open "GET",xURL,False
    .Send
    b = .ResponseBody
    If Err.Number <> 0 Or .Status <> 200 Then
    MsgBox Err.Number & " " & .Status
    Fetch = False
    Exit Function
    End If
    End With
    With CreateObject("ADODB.Stream")
    .Type = 1
    .Open
    .Write b
    .SaveToFile xOUT,2
    End With
    Fetch = Err.Number = 0
    End Function


    Function Print(xURL)
    Dim objShell
    set objShell = CreateObject("Shell.Application")
    objShell.ShellExecute xURL, "", "", "print", 1
    set objShell = nothing
    End Function


    "bradley" <> wrote in message
    news:%...
    > An ActiveX control is basically a COM compenent, typically with GUI
    > elements, that can be hosted by a container, such as a Windows Form or web
    > page, and scripted. It is similar in concept to a Java applet, except that
    > there are no restrictions about accessing the client's resources and file
    > system. It is a full blown Win32 executable, but with the extention OCX.

    The
    > clients browser security settings will need to be configured to allow

    this.
    > I think that by default IT will allow, but displays a confirmation dialog
    > before downloading the control.
    >
    > Below are some MSDN articles..
    >
    > HOW TO: Host ActiveX Controls in a Web Form
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;317392
    >
    > PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
    > Applications in Visual Basic .NET
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;311300
    >
    > Visual Basic 6.0 is the best (most user friendly) tool for building

    ActiveX
    > controls. The client will need to have the VB6 runtime installed on their
    > PC, but Windows 2000/XP comes bundled with this.
    >

    http://msdn.microsoft.com/library/d...s/vbcon98/html/vbconcreatingolecomponents.asp
    >
    > However, if it were me, I would first try to implement a solution that
    > involved building WSH scripts dynamically on the server and then have the
    > client click on an execute them. A few lines of VB Script is much more
    > simple to program and maintain than delving into ActiveX control building,
    > especially if you havn't built one before.
    >
    > http://msdn.microsoft.com/scripting
    >
    > You didn't say what type of documents you are wanting to print, so I'm
    > assuming MS Word or Adobe PDF. You can find example script on the web for
    > automating MS Word and perhaps Adobe using WSH.
    >
    > http://www.vandyke.com/support/crt/scripts/run_word_vbs.txt
    >
    > Just like ActiveX controls, the client's browser security settings will
    > probably need modfying to execute .vbs or .js scripts from the web.
    >
    > If you get this working, then reply back to the group with details.
    >
    >
    > "Shawn" <> wrote in message
    > news:%...
    > > Hi.
    > > I've never created an ActiveX control before, so I know little about

    what
    > it
    > > is capable of and what its limitations are. My problem is this: I have

    to
    > > create a way to send multiple documents from the web server to a printer

    > on
    > > the user's network. The way it works today the user has to manually
    > > download each document and send it to his printer, but now they want me

    to
    > > create an automated process.
    > > Will I be able to download documents to the user's temp catalogue with

    an
    > > ActiveX control? If I can do that I can just send them to his default
    > > printer using ShellExecute.
    > >
    > > Need to know if this is possible before I start researching :)
    > > If anyone can provide me with a good tutorial that would be great!
    > >
    > > Thanks,
    > > Shawn
    > >
    > >

    >
    >
    Shawn, Jun 24, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hattuari
    Replies:
    11
    Views:
    834
    Julie J.
    Feb 26, 2004
  2. vml
    Replies:
    0
    Views:
    1,030
  3. Tom Anderson

    Re: Does final serve any purpose?

    Tom Anderson, Oct 13, 2010, in forum: Java
    Replies:
    4
    Views:
    259
  4. Kevin McMurtrie

    Re: Does final serve any purpose?

    Kevin McMurtrie, Oct 14, 2010, in forum: Java
    Replies:
    4
    Views:
    276
    Kevin McMurtrie
    Oct 15, 2010
  5. Peter
    Replies:
    8
    Views:
    310
    Jorgen Grahn
    Dec 29, 2012
Loading...

Share This Page