Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert to VBScript

Status
Not open for further replies.

MCas86

Programmer
Mar 31, 2010
4
US
I'm creating an ASP.NET web app. I have some code that I need to run on the clientside. However, the only code I have is being run serverside (VB.NET). Is there anything I can use to convert it to VBscript? Or can someone do it for me? It's not much code. Although, I have no idea how difficult it may be. I'm trying to use 'ClickYes' on the clientside because I'm using Outlook on the client's computer to send email. Before you ask, I'm not using SMTP because its blocked by the company.

Code:
Private Declare Function RegisterWindowMessage _
            Lib "user32" Alias "RegisterWindowMessageA" _
            (ByVal lpString As String) As Long

    Private Declare Function FindWindow Lib "user32" _
            Alias "FindWindowA" (ByVal lpClassName As String, _
            ByVal lpWindowName As Integer) As Long

    Private Declare Function SendMessage Lib "user32" _
            Alias "SendMessageA" (ByVal hwnd As Long, _
            ByVal wMsg As Long, ByVal wParam As Long, _
            ByVal lParam As Long) As Long

    Public Sub Turn_Auto_Yes_On()
        Try
            Dim wnd As Long
            Dim uClickYes As Long
            Dim Res As Long
            uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
            wnd = FindWindow("EXCLICKYES_WND", 0&)
            Res = SendMessage(wnd, uClickYes, 1, 0)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Public Sub Turn_Off_Auto_Yes()
        Try
            Dim wnd As Long
            Dim uClickYes As Long
            Dim Res As Long
            uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
            wnd = FindWindow("EXCLICKYES_WND", 0&)
            Res = SendMessage(wnd, uClickYes, 0, 0)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
 
depending on what your end purpose is there is another free addon that performs similar functions to ClickYes, but with less user interaction, called "Advanced Security for Outlook". I have been testing it as a replacement for ClickYes for our users and so far found no problems.
If you do get a client-side script, i would be interested in seeing just how you did it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top