Link to home
Start Free TrialLog in
Avatar of Chris Miller
Chris MillerFlag for United States of America

asked on

Net Send to User III

I have this working but how can I show the user that it was sent from instead of the computername?

Private sub Comman1_Click()
 Shell "cmd /c net send " & Text1.Text & " " & Text2.Text
 Text1.Text = ""
 Text2.Text = ""
End Sub
ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

let me correct my typo...
Shell "cmd /c net send " & Text1.Text & " From: NATALIA -" & " " & Text2.Text
You can also mess around with the Net Name command

Net name              list current net send users
Net name /ADD BOB
Net name /DELETE BOB
CMILLER, I take it your using Windows Messenger, I created some Late Binding to control Windows Messenger itsef if you ever want to use this in the future you may.
All you need to do is copy/paste all the code below into a module (.BAS)


Option Explicit
'******************************************
'Windows Messenger Online Status Constants
Const MISTATUS_OFFLINE = 1
Const MISTATUS_AWAY = 34
Const MISTATUS_BUSY = 10
Const MISTATUS_IDLE = 18
Const MISTATUS_BE_RIGHT_BACK = 14
Const MISTATUS_INVISIBLE = 6
Const MISTATUS_ONLINE = 2
'******************************************
Public Enum eglMicrosoftMessenger       '\\ Microsoft Windows Messenger
        eglOnlineStatus = 1             'Checks your online status
        eglMySigninName = 2             'Returns your messenger sign in name
        eglMyFriendlyName = 3           'Returns your messenger friendly name
        eglMyServiceName = 4            'Returns service name (.NET)
        eglAutoSignIn = 5               'Signs into messenger automatically (Must have remember password checked)
        eglSignOut = 6                  'Disconnect or Sign out of messenger
        eglInstantMessage = 7           'Open instant messenge
        eglAddContact = 8               'Adds a contact
        eglSendMail = 9                 'Opens default mail application and inserts e-mail address
        eglOpenInbox = 10               'Opens default mail application and check the Inbox
        eglReceiveFileDirectory = 11    'Messenger recieved file directory
        eglSendFile = 12                'Send a file to a contact
End Enum
Dim MMessenger As Object

Public Sub eglMSNMessenger(eglMsnger As eglMicrosoftMessenger, Optional bstrString As String = vbNullString, Optional strSendFile As String = vbNullString)
'WARNING: Some of the calls will not work if you don't specify someone who is on your contact list!
On Error GoTo objLateBindErr
Set MMessenger = CreateObject("Messenger.UIAutomation")

Select Case eglMsnger

    Case 1
If MMessenger.MyStatus = MISTATUS_OFFLINE Then Debug.Print "OFFLINE"
If MMessenger.MyStatus = MISTATUS_AWAY Then Debug.Print "AWAY"
If MMessenger.MyStatus = MISTATUS_BUSY Then Debug.Print "BUSY"
If MMessenger.MyStatus = MISTATUS_IDLE Then Debug.Print "IDLE"
If MMessenger.MyStatus = MISTATUS_BE_RIGHT_BACK Then Debug.Print "BE RIGHT BACK"
If MMessenger.MyStatus = MISTATUS_INVISIBLE Then Debug.Print "INVISIBLE"
If MMessenger.MyStatus = MISTATUS_ONLINE Then Debug.Print "ONLINE"
    Case 2
Debug.Print MMessenger.MySigninName
    Case 3
Debug.Print MMessenger.MyFriendlyName
    Case 4
Debug.Print MMessenger.MyServiceName
    Case 5
MMessenger.AutoSignin           '\\ NOTE: You must have your username and password remembered for this to work.
    Case 6
MMessenger.Signout
    Case 7
MMessenger.InstantMessage (bstrString)
    Case 8
MMessenger.AddContact 0, (bstrString)
    Case 9
MMessenger.SendMail (bstrString)
    Case 10
MMessenger.OpenInbox
    Case 11
Debug.Print MMessenger.ReceiveFileDirectory
    Case 12
MMessenger.SendFile (bstrString), (strSendFile)
End Select
Set MMessenger = Nothing
objLateBindErr:
Debug.Print Err.Number & "   " & Err.Description
Set MMessenger = Nothing
'**************************************************
'Microsft Windows Messenger: USAGE: msmsgs.exe/3
'**************************************************
'Call eglMSNMessenger(eglAddContact, "egl@na.com")
'Call eglMSNMessenger(eglAutoSignIn)
'Call eglMSNMessenger(eglInstantMessage, "egl@na.com")
'Call eglMSNMessenger(eglMyFriendlyName)
'Call eglMSNMessenger(eglMyServiceName)
'Call eglMSNMessenger(eglMySigninName)
'Call eglMSNMessenger(eglOnlineStatus)
'Call eglMSNMessenger(eglOpenInbox)
'Call eglMSNMessenger(eglReceiveFileDirectory)
'Call eglMSNMessenger(eglSendFile, "egl@na.com", "c:\windows\system32\calc.exe")
'Call eglMSNMessenger(eglSendMail, "egl@na.com")
'Call eglMSNMessenger(eglSignOut)
'************************************************************************************
End Sub