By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

Will an ActiveX control serve this purpose?

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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...b;en-us;317392

PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
Applications in Visual Basic .NET
http://support.microsoft.com/default...b;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/de...components.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/s...n_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" <bo********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 19 '05 #2

P: n/a
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" <so*****@microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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...b;en-us;317392

PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
Applications in Visual Basic .NET
http://support.microsoft.com/default...b;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/de...components.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/s...n_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" <bo********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.