How to add vb6 activex component into...
im creating a activex component in vb6.0 which sends tasks.
I want to utilize this activex control on an ASP.net web page...
Lets say I ve created the ocx (compiled it) and what not..and I go into Visual Studio.net...I create a new project..I have webform1.aspx...I want to add this user control activex from vb6.0 to this page...what files do I need to "add". How do I add this user control.
Also after adding it how do I call a property or method of it...
I have been trying to do this with some problems. I cannot seem to figure out how to physically add this active x component into vs.net.
Anyone with some info please
(Posting this in vb.net and asp.net since they are all related)
Thanks,
Jon
Re: How to add vb6 activex component into...
If it helps here is my code in vb6.0
First off I refernece outlook olb 10.0 or 11.0 one of those forget...
I needed some properties to store the name, subject, body, and to fields:
VB Code:
Option Explicit
Private strSubject As String
Private strBody As String
Private strResp As String
Private strOptional As String
Then I created let's and gets for setting and retreiving these properties
VB Code:
Public Property Let Subject(Value As String)
strSubject = Value
End Property
Public Property Get Subject() As String
Subject = strSubject
End Property
Public Property Let Body(Value As String)
strBody = Value
End Property
Public Property Get Body() As String
Body = strBody
End Property
Public Property Let Responsible(Value As String)
strResp = Value
End Property
Public Property Get Responsible() As String
Responsible = strResp
End Property
Public Property Let OptionalResponsible(Value As String)
strOptional = Value
End Property
Public Property Get OptionalResponsible() As String
OptionalResponsible = strOptional
End Property
Then I create task...NOTE that I am just testing right now so code might not be elite :)
VB Code:
Public Sub CreateTask()
On Error GoTo Err_Handler
Dim NameSpace As Object
Dim EmailSend As TaskItem 'for the task
Dim EmailApp As Object
Set EmailApp = CreateObject("Outlook.Application") 'using the outlook object
Set NameSpace = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(3) '3 = an outlook task
EmailSend.Subject = "test"
EmailSend.Body = "test"
EmailSend.Recipients.Add (strResp) 'add the recipient
EmailSend.Assign 'assign task to recipient
EmailSend.Send 'send the task
MsgBox "The request has been e-mailed successfully to '" & strResp & "'.", vbInformation, "Request Sent Successfully"
Done:
Set EmailSend = Nothing
Set NameSpace = Nothing
Set EmailApp = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Description, vbCritical, "Error #: " & Err.Number
Resume Done
End Sub
Then I just created a button to call it
VB Code:
Private Sub Command1_Click()
CreateTask
End Sub
Ideally once I get this working for this cheap example Ill use the properties get / let to pass text from web controls to these entities and have it send the task.
So if someone can even please use my code and maybe post their entire VS.net solution as an aspx project. Or even give me some steps in getting this to work.
Woka anyone I know you're out there!
Thanks,