Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Help!!! How To Send Fax? Help!!!!


Hey All!Ineed help! fast!!how can i send fax from my VB app?i already try to use the CommonDialog and choose the fax in the printer defult, but no use, it doesnt work at all!please help me with this one...(a bit of code will help)Thanks anyway. Amit ;=)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
FaxDocument.Send Method 'send' Of Object 'IFaxDoc' Failed
I've searched the web and read about 100 pages on MSDN and I dont understand why the following code doesn't work. It error out everytime on the FaxDocument.Send line with a RunTime Error '-2147024890 (80070006) Method 'send' of object 'IFaxDoc' failed

I am a member of the domain group administrators and have full permissions to manage the fax server. I am sending it from my laptop to a 2003 Server Microsoft Fax Services Fax Server.

Any Ideas would be great.

Public Function SendFax(FileName As Variant, FaxNumber As Variant, RecipName As Variant)

Dim objFaxServer As FaxServer
Dim FaxDocument As FaxDoc

Set objFaxServer = CreateObject("FaxServer.Faxserver")

Dim sSName As String
Dim iMsg As Integer

objFaxServer.Connect "//GLP-FAX"
objFaxServer.Connect "//GLP-FAX"

objFaxServer.ArchiveOutboundFaxes = 1
objFaxServer.Retries = 4
objFaxServer.RetryDelay = 4

Set FaxDocument = objFaxServer.CreateDocument(FileName)
FaxDocument.FaxNumber = FaxNumber
FaxDocument.DisplayName = "Tim"
FaxDocument.FileName = FileName
FaxDocument.Tsid = RecipName
Dim lSend As Long

FaxDocument.send

End Function


Sub TestFax()


Call SendFax("C: est.doc", "1234567", "TEST")
End Sub

My Program Be Pause Because Send ObjXMLHTTP.send URL Method
Hi All
    
   Set objXMLHTTP = New MSXML2.XMLHTTP
    objXMLHTTP.open "GET", mURL, False
    objXMLHTTP.send URL
   request = objXMLHTTP.responseText

my program be pause when its exexuting send method above.
its activity usual after finished send method and get result return request
How to my program do not pause when its executing send method?
help me please! thanks before

My Program Be Pause Because Send ObjXMLHTTP.send(URL) Method
Hi All
     
   Set objXMLHTTP = New MSXML2.XMLHTTP
    objXMLHTTP.open "GET", mURL, False
    objXMLHTTP.send URL
   request = objXMLHTTP.responseText

my program be pause when its exexuting send method above.
its activity usual after finished send method and get result return request
How to my program do not pause when its executing send method?
help me please! thanks before

Launch Outlook's Send Msg Dialog, But No Send
Thank you Lafor & HeSaidJoe for helping me out on my last Outlook question. Here's another one for you or any one of you children out there...

Without using an API call (anyone know if we're privy to one?) how can you get the Send-to dialog displayed so the user can have control to edit/send/save/cancel?

Send Error Report/Don't Send - Errors
Hi All,

Got an app that prints off (printer.print technique) a number of items from a dynamic list. if the list is more than 10 items or so the application crashes with an XP Send Error Report/Don't Send type error. Nothing wrong with my logic, and the error handling I put in doesn't get executed. Has anyone come across this before, or have any suggestions?

Thanks In Advance


Noogle

Outlook - VBA Send Email But Don't Use .send
Hey again,

With the vb6 plugin for outlook, I can create an email with multiple recipients but I need to send an email to each recipient individually but not have it register as a sent item in the Sent Folder each time the email has been sent out. Is there a way to do this?

Any thoughts?

Is there something that I can use that is similar to .SendMail (excell). I am currently not using the MAPI either.

How To Send HTTP Post Data Such As That Created By A HTML FORM And Send The Data To A Server
Hello List,

I am looking for examples in how to send HTTP Post data to a server and
wonder if anybody will have an example I can refer to.

Best regards,

Bruno Romero

On App Exit, "Microsoft Error: Send/dont Send"
sometimes, there is a Microsoft send/dont send error in my compiled app but only when I exit the app. I used PDW to compile it, and i am rinning vb6 with sp6.

It is a multi-form ADO app. Nothing exotic.

Any thoughts?

Send Command, Wait 2 Seconds, Then Send Command Again
Here is the process I need.

Click a command button that will send chr(24) out the serial port, then wait 2 seconds, then send chr(24) out again.

Can I reference a pause subroutine or something like that?

For instance:

Private Sub Command5_Click()
MSComm1.Output = Chr(24)
Call pause 'subroutine to wait 2 seconds
MSComm1.Output = Chr(24)
Call pause 'subroutine to wait 2 seconds
MSComm1.Output = "3"
End Sub

How To Send A Fax
Hi,all

Is it possible to send a Fax by Vb,If yes then Which class or object will be used and by which method,If any guiding tutorial is available,plz do tell me.

thanx in advance.

Net Send Outside Lan?
Is there a way to net send from the shell to a computer outside the lan if they turn on their messanger service?

Net Send In VB
So I made a program to send net send messages without having to open the command prompt. Essentially it uses the command prompt command just with a nicer user interface. I was wondering if there is any way I could change the computer it says it comes from. Example:

Message from Computer1 to Computer2 on 1/16/2005 12:39:39 PM

That's what a net send message says I want to know if there is any way to change the nmae of the "Message From:" I'm doing my best to explain I hope you can get it. Thanks.

Best Way To Send Fax
Hi
Have a customer table etc
What is the most efficent way to fax a report to customers.
Mapi or use the microsoft fax or is there a control like mscomm.
Cheers

Send SMS With VB?
Is it possible to send SMSs with VB. I don't even know how the websites that let you send them do it. I'm guessing it isn't possible but it sounds interesting and rather cool if it is! Any thoughts?

Net Send
ok, this is prob real simple to you guys, i dont know!
was messin bout, wiv th net send code in VB, you kno..
Shell ("net send " & Text1.Text & " " & Text2.Text) bla bla
i know you should be able to send to an IP addy, my intentions wer to msg my mates to ther IP, i dont kno if it actually is possible. do i maybe have to specify a port?
how can i do a net send to an IP address? thanks for any replies.

VB And Net Send
hi guys and girls

is there a way that when a visual basic program is open, that it can catch all incoming net send information in a string (or any other form)?

any help would be much appreciated.

thanks

Mºjºinst

DCC Send
I currently have an IRC BOT that sends files correctly, but when I initially send the DCC Send request, it says that the file is 1.18mb long..How do I send the correct file size in the request?

Example To Send SMS
Hello,

i've searched for code to send Sms messages with a mobile phone, for example with Nokia 3310.

I've found this code:

'You need the freeware ASMSCTRL.DLL to run the sample.
' Download it from http://www.vahland.com/pub/asmsctrl.dll
' and register it on your machine.
' Read http://www.vahland.com/pub/asmsctrl.htm for more info

Option Explicit

Dim asObj

Set asObj = CreateObject( "ActiveXperts.SMSC" )

' MODEM PROPERTIES
Do
asObj.PortID = inputbox( "On which Comport is modem or GSM connected? (1, 2, 3, ..)", "Input" )
Loop until asObj.PortID <> ""

' SENDER and RECIPIENT
asObj.Sender = "00000000000" ' Set your phone number here; only digits are allow, minimum 1 character, max. 16 characters
Do
asObj.Recipient = inputbox( "Enter the recipients phone number (only digits allowed, no spaces etc.)", "Input" )
Loop until asObj.Recipient <> ""

' MESSAGE
Do
asObj.MessageText = inputbox( "Enter the message text you want to send to the recipient. Only the first 160 characters of the message will be sent", "Input" )
Loop until asObj.MessageText <> ""


' Send the mesage to the recipient through the locally connected GSM phone
WScript.Echo "Sending the message..."
asObj.SendMessage FALSE ' FALSE means: not through provider, but through direct connected GSM

If( asObj.LastError <> 0 ) Then
WScript.Echo "Failed to send message, error: " & asObj.LastError & " (" & GetErrorString( asObj.LastError ) & ")"
WScript.Echo "To trace all commands sent/received through modem, set the 'LogFile' property,"
WScript.Echo "for instance, asObj.LogFile = " & Chr( 34 ) & "c:mylog.txt" & Chr( 34 ) & "."
Else
WScript.Echo "Message successfully delivered"
End If

' ********************************************************************

Function GetErrorString( lError )
GetErrorString = "Unknown error"
Select Case lError
Case 0
GetErrorString = "SUCCESS"
Case 1
GetErrorString = "Evaluation period has expired"
Case 2
GetErrorString = "License was entered, but invalid"
Case 10
GetErrorString = "Invalid provider dial string"
Case 11
GetErrorString = "Message was sent to SMS provider, but no reponse received"
Case 12
GetErrorString = "Message was sent to SMS provider, SMS provider reported a synax error"
Case 13
GetErrorString = "Message was sent to SMS provider, SMS provider didn't accept message"
Case 30
GetErrorString = "Invalid sender address"
Case 31
GetErrorString = "Invalid recipient address"
Case 32
GetErrorString = "Invalid message"
Case 50
GetErrorString = "No response from modem"
Case 51
GetErrorString = "Unexpected response from modem"
Case 52
GetErrorString = "Error response from modem"
Case 53
GetErrorString = "No dialtone detected upon attempt to connect to remote party"
Case 54
GetErrorString = "No carrier reported while connecting to remote party"
Case 55
GetErrorString = "No answer reported while connecting to remote party"
Case 56
GetErrorString = "Busy tone reported while connecting to remote party"
Case 100
GetErrorString = "Generic port Error"
Case 101
GetErrorString = "Invalid parameter"
Case 102
GetErrorString = "Invalid port. Most probably, port does not exist or is in use"
Case 103
GetErrorString = "Unable to perform operation because port it already opened"
Case 104
GetErrorString = "Generic open port error"
Case 105
GetErrorString = "Unable to initialize port"
Case 106
GetErrorString = "Unable to write to port"
Case 107
GetErrorString = "Unable to write directly to port"
Case 108
GetErrorString = "Unable to read from port"
Case 109
GetErrorString = "Unable to retrieve device information"
Case 110
GetErrorString = "Unable to change device settings"
Case 111
GetErrorString = "Unable to purge the port"
Case 112
GetErrorString = "Timeout"
End Select
End Function


But if I try to run this code then I get this error:

WScript.Echo "Sending the message..." ==> WScript = Variable not defined.

I've put the dll file in my reference so this cann't be the problem.

I know that this code is working because some answers of peoples on other forums.

But I can't find the solution. Any idea...??

BR, Peter.

'net Send'
Could someone please give me the VB6 code (perhaps using 'net send') to send a message to other computers on the WAN / Internet?
We have branches / affiliates in several states and I need to have a way to send alerts. I wrote an application using 'net send' which found limited to send to computers within the LAN at my location.
Is there any particular required setting for my computer?

Net Send
Could someone give me the code for using net send in vb6 please.
If you can't use net send in vb6 is there anything else that can be used to send a message to another computer on a LAN?

Net Send && VB HELP!
Ok, I am making a program for my network so I can send NetSend messages through VB.

I can send the messages and everything, but I am trying to figure out a couple features.

I am using Shell though.

I have a text box..(text2) and I want the message to say it was from whatever you type into the textbox...Not the computers name.

The second thing I am trying to figure out how to do is send a message to a range of IP's. So I type a start IP (text4) and an end IP (text5) and I want it to be able to send to the IP's between and including the 2 numbers you type.

If you need any more clarification please ask. And thanks for the help!

Net Send
Hi i am trying to make a program that sends a messege to a computer but you have to type in their ip in box can anyone tell me how i do this?

Send
I am trying to modify this code to send mails from my application
can you tell me how to open the outlook to be able to edit the message within the outlook befoe sending it...


MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose

MAPIMessages1.RecipDisplayName = "dlmsupport@emirates.com"
MAPIMessages1.MSGSUBJECT = "Test Mail"
MAPIMessages1.MsgNoteText = "Testing the MAPI "

lstrMsgNote = MAPIMessages1.MsgNoteText
MAPIMessages1.ResolveName
MAPIMessages1.Send
MAPISession1.SignOff

Send SMS
Hi I want to know if is possible to send SMS messages to mobile phones, I want to make an application, I want to send to through this URL:

http://www.telefonica.com.gt/movista...jes_cortos.htm

and
http://www.bellsouth.com.gt/sms/sms.asp

also

http://www.pcsdigital.com.gt/mensajes.htm

is possible, and what I need to do?

thanks.

Dcc Send
this might have been answered but i can't search for "dcc" as it is less then 4 letters long

anyway, i'm making an irc program of sorts and i'm trying to add dcc send to it, i got chat working no problems. but send has me stuck i get the connection and some data. But in the protocol it says

"The recipient should acknowledge each packet by transmitting
the total number of bytes received as an unsigned, 4 byte integer in network byte order"

i tried sending the len() of the data that it sent to me, but it didn't work (actully it closed the connection on me). how do i do as described above?

Send Sms
how can I send a sms from pc to mobile ? (I do not have gsm modem)

Send SMS With VB6 - Please Help
Hi guys,

I've been searching and reading for a while now about AT-commands and sms with VB.
I tried to develop a program that kan send an sms using the bluetooth (virtual serial port on com 7) connection of my Samsung E720 phone. But still no luck. I managed to send an sms using MS hyperterminal so i know that my phone can handle AT-commands.
When i try to use these commands in VB i'm unable to send a text message. Is there a way to monitor what is happening (step by step)?
Or can someone tell me what is wrong with my code. I also know that there quite a bit of posts about the sms topic but none of them seem to contain a proper solution...

As you can see, i use mscomm to communicate with the phone.
Just to be clear, i know that there are bulk sms providers but i don't want to use such a service.

Here is the code extract:

MSComm1.CommPort = 7 ' Com4 Port
MSComm1.Settings = "115200,n,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.Output = "AT" & Chr$(13) & Chr(10)
MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
MSComm1.Output = "AT+CMGS=" & Chr$(34) & "+32477777777" & Chr$(34) & Chr(13) & Chr(10)
MSComm1.Output = "This is a testing message " & Chr(26)
MSComm1.PortOpen = False

Thanks for any help!

Net Send
Can anyone let me know the full shell net send command for VB6

NET SEND From VBA
Hello. This is my first post here. I have tried searching for threads containing "NET SEND" but I get a message saying that "NET" is too short, and I need to enter at least 4 characters.(why?) So I apologize if this topic has been addressed already.

I have an Access database that my users can enter Service Calls. I work for a small Engineering company of about 100 employees. I want to be able to recieve a NET SEND message when the user saves the record. I have no idea where to start. I only have experience with VBA for Access, and I'm still on the learning curve.

Right now I have an email being generated when they save the record, but I'm not happy with that method. The users have to click "Yes" to "Allow Access to send an email on thier behalf." This is a security feature of Outook 2002. I cannot get around it.

I figure a NET SEND message would be a better way for me to get the notification. I know how to use NET SEND manually, but need help with where to start with code.

I'm using Office XP (2002), Windows 2002 Pro, some clients have Windows 98 SE, and XP Pro.

Thank you in advance.

VBA NET SEND
i'm working on a netsend script in access, i have 1 textbox, 1 dropdownlist and one button..

This is howfar i got untill now.




Code:
Option Compare Database
Option Explicit
'Declare the global variables.
Dim strSend3TimesNoMore As String
Dim strCountTimes As Integer

Private Sub Form_Close()
'If the close button is clicked, close the whole database instead of just the form.
DoCmd.Quit
End Sub

Private Sub Button_Click()
Dim start As Date
Dim recString As String
Dim berString As String


'Give the textboxfocus to control the data.
Me.Text0.SetFocus
'Putt the textbox's value in the string.
strSend3TimesNoMore = Me.Text0.Text

'If strCountTimes = 3 reset the textbox and display a warning.
If strCountTimes = 3 Then MsgBox "You can only send the same message 3 times"
If strCountTimes = 3 Then
'Call textbox reset function
ResetMessagebox
ResetCounters
Exit Sub
End If

'Give the textboxfocus to control the data.
Me.Text0.SetFocus

'If the textbox.text does not contain any data show a message.
If Me.Text0.Text = "" Then
MsgBox "U have to enter a message"
Exit Sub
End If

'Putt the textbox's value in the string.
'strSend3TimesNoMore = Me.Text0.Text
berString = Me.Text0.Text

'Give the textboxfocus to control the data.
Me.Text3.SetFocus

'Putt the name of the recipient in the recString.
recString = Me.Text3.Text

'Execute the netsend shell command and send the message to the recipients computer.
Shell ("NET SEND" & " " & recString & " " & berString)

'Change the value of start into the current time
start = Now

'Disable the send button to prevent users from sending multiple messages instantly.
If Me.Button.Enabled = True Then Me.Button.Enabled = False

'Time 3 seconds of delay
While DateDiff("s", start, Now) < 3
DoEvents
Wend

'Enable the send button again so the user can send the next message.
If Me.Button.Enabled = False Then Me.Button.Enabled = True

'Check if the text in the message has changed if it did reset the counter, if it did not add 1 to the counter.
If strSend3TimesNoMore = berString Then strCountTimes = strCountTimes + 1 Else ResetCounters

End Sub

Public Function ResetMessagebox()
'Give the textbox focus to control the data.
Me.Text0.SetFocus

'Set the data in the textbox to nothing.
Me.Text0.Text = ""
End Function

Public Function ResetCounters()
'Reset the counters.
strCountTimes = 0
strSend3TimesNoMore = ""
End Function



I know it's still a mess i have one error i can't get out of it.. i want that when you enter the same message 3 times and send it it gives a message and resets the fields, but when you change the message after sending it it should not reset.. but somehow it always resets after 3 times..

Help me

P.S. To the experts.. I'm a nono concerning VB/A can one of you maybe show how this whole thing can be done in a much simpeler way, it would really be good for me to have pointed out what i'm doing wrong and where i'm thinking wrong.

I'd be more that greatfull,

Thanks in advance.

Send To
Can I make this code get the email address from a named range ?
ActiveWorkbook.SendMail Recipients:=
ive tried the code below but it doesnt work.
ActiveWorkbook.SendMail Recipients:=Sheet2.Range("OfficeEmail")

Net Send
I used it as school now i can't remember the code for the net send windows command for VB 6, anyone happen to know what it is

Send Msg To Msn... How?
How do i create a file than sends a hello to everybody on my msn contact list, without annoying them?

got no clue... ive googled alot to find something, but no luck...

Please help me..
Thanks

Net Send
Hi.
You know that command you can type in at the run prompt like:

net send ComputerName "Hi, how are you doing?"

It displays a messagebox (or maybe form) on the recieving computer, with the message. I need to somehow get the text on it and close it. Is this possible and if yes how??

I tried using GetActiveWindow to find it and SendMessage with WM_GETTEXT but it always turns out there's no text on it (although it's plainly visible that there is a message).

Thanks for the help.

Net Send
Sending System Messages using NetMessageBufferSend. What I would also like to do is RECEIVE the message sent into a textbox, instead of the popup messenger box window that is received after the message has been sent...Any ideas???

Thanks

Send SMS
In my existing ASP application, I want to allow user to send SMS to customer, but I have no idea about it.

Anyone help?

Send A Fax
Hello

In my customer form I have a field called Fax (it is a fax number).
Is it possible to send a fax for all my customers that have this field filled, I mean, I make a filter check in the database and then send a fax? If yes, do I need a software as WinFax?

Thank you for your time

How I Can Send A Key To Another App?
im working with personal communications(IBM) and i need to send a key (F11) but i cant do this with sendkeys...
im working with access 97

Net Send?
I need as much info as possible on the net send function. I am trying to incorporate a "chat" window on a program i created that allows users to enter and manage their time. What i want to do is hace the ability to send a popup window to a user over a NT network (ex. "Hey, you should print your time sheets) or whatever...Is that possible?? Or should I use another function that net send? Please help...

*If the birds would'nt have wings, they would'nt fly...

Net Send On Win NT And Win XP
OK I am new to VB but I managed to create a program which automates the sending of netsend messages. I know that the windows message service is active as I can use the DOS version. I designed it on my Win XP PC at home and as I dont have a big network I just sent a message to myself and it worked however after I created an .exe file and brought it into work to give it a try it does not seem to be picking up the Send to listbox value. any ideas
is it a compatible problem? Should I use the deploy wizard as I only copied the .exe file that I created.

Any help would be appreciate.

Net Send
Hello,

First, I don't know VB at all so if anyone helps me, please give me a chance...

Here's what I would like to do:

I would like to create a document in which I will have a text box and a send button. Basically, I would like to take the info in the text box and when I click on send, I want to send it via NET SEND to a list of people.

As example, if I write "Hello everyone!!!" in the text box and click on send, I would like to have the following commands done:

net send aa001111 Hello everyone!!!
net send bb002222 Hello everyone!!!
net send cc003333 Hello everyone!!!
net send dd004444 Hello everyone!!!

Thanks!!!

Using XML To Send SMS
Hello Again

I have some code that uses XML to send alarm messages via SMS, to mobile phones:-


1) An event is triggered - either a serial input or via a winsock connection

2) The string from either trigger is sent to a sub procedure to translate the message

3) The SendSMS routine is called and looped around to send SMS (below) to many people from a DB.



Private Sub SendSMS(Destination, Message)

Dim xmlrequest As MSXML2.XMLHTTP
Set xmlrequest = New MSXML2.XMLHTTP

xmlstring = "<?xml version=" & """" & "1.0" & """" & "?> " & _
"<SMSRequest xmlns=" & """" & "x-schema:smsxml.xml" & """" & ">" & _
"<Userid><![CDATA[" & iniSMSUsername & "]]></Userid>" & _
"<Password>" & iniSMSPassword & "</Password>" & _
"<RequestList>" & _
"<Request>sendMessage</Request>" & _
"<Message><Destination>" & Destination & "</Destination>" & _
"<Text>" & Message & "</Text></Message>" & _
"</RequestList>" & _
"</SMSRequest>"

xmlrequest.Open "post", iniSMSURL, False
xmlrequest.setRequestHeader "content-type", "text/xml"
xmlrequest.send xmlstring

End Sub



The code above works but there is a fundamental problem. My application comes to the code and stalls as it is executing the send line causing my speech system to stutter and generally behave badly.

Setting the ASYNC feature allows program control to be returned immediately but I have found this to be unreliable when looping round sending SMS, as some SMS messages don't get sent. I imagine this to be because it hasn't finished sending the previous message.

I am confused and fail to see how I am supposed to handle and wait for things like this, reliably, without distrupting the rest of my processing when VB is single threaded. Am I missing something?

Send 2 Sms
Hi!
I have written a program to send a record via sms, the problem i am facing now is that when the record is more than 160 characters example 200 then my program should send 2 sms.......the 1st sms will consist of the first 160 chars then the 2nd sms will send me the rest 40 characters but the problem is that it never send me the 2nd sms that consist the remaining 40 chars........can someone know please help me! THis is super urgent!!!

Code:
Private Sub cmdsearch_Click()

Dim Find As String
Dim myArray() As String
Dim tempArray() As String
Dim tempName As String
Dim count As Integer
Dim blankCount As Integer
Dim i As Integer
Dim j As Integer
Dim pos As Integer
Dim found As Boolean
Dim recordCount As Integer
Dim present() As Boolean
Dim bytes As Integer
Dim myString As String
Dim tempstring As String
myString = ""

MSComm1.Output = "AT+CNMI=0,1,0,0,0" + vbCr 'Receive incoming SMS

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
' MsgBox (FromModem$)

Exit Do
End If
End If

Loop

FromModem$ = ""
temp = MSComm1.Input


MSComm1.Output = "AT+CMGF=1" + vbCr 'Change to text mode

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then


Exit Do

End If

End If

Loop

FromModem$ = ""
temp = MSComm1.Input


MSComm1.Output = "AT+CMGR=1" + vbCr 'Read SMS received

Do
dummy = DoEvents()
If MSComm1.InBufferCount <> 0 Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
Timer1.Enabled = False
Sleep 100
Find = FromModem$
p = InStr(Find, "9")
num = Mid(Find, p, 8)

Ps = InStr(Find, "+")
Ps1 = Mid(Find, Ps, 6) 'Look out for 2nd"+" and display+CMGR

Pf = InStr(Ps + 1, Find, "+") '+CMGR
Pf1 = Mid(Find, Pf, 5)


Ps = InStr(Pf + 1, Find, "+") 'display hp no
Ps1 = Mid(Find, Ps, 11)

Pf = InStr(Ps + 1, Find, "+")
Pf1 = Mid(Find, Pf, 6) 'display +00

Ps = InStr(Pf + 1, Find, Chr(34)) 'Display name to search with OK
Ps1 = Mid(Find, Ps + 1)

Ps1 = Replace(Ps1, "OK", "") 'Remove OK and display only the name to search in the textbox
Ps1 = Replace(Ps1, vbCrLf, "")
Ps1 = Replace(Ps1, vbCr, "")
Text1.Text = (Ps1)

Exit Do

End If

End If

Loop



EmpList.ListItems.Clear
myString = ""


Find = Trim(Text1.Text)
If (Find) = "" Then
MsgBox "No search-name specified. "
Text1.Text = ""
Text1.SetFocus
Else
pos = 0
blankCount = 0
found = True

Do While found
pos = InStr(pos + 1, Find, " ", vbTextCompare) 'search for ""

If pos <> 0 Then
blankCount = blankCount + 1
Else
found = False
End If
Loop

If blankCount > 0 Then '"" found then split Find into arrays
myArray = Split(Find, " ")
Else
ReDim myArray(1)
myArray(0) = Find
End If

ReDim present(blankCount + 1)

Data1.DatabaseName = "D:Silingdb1.mdb"
Data1.RecordSource = "MYDATA"
Data1.Refresh

If Data1.Recordset.EOF Then
MsgBox "No records found! "
Text1.SetFocus

Else
recordCount = 0

Do While Not Data1.Recordset.EOF
tempName = Data1.Recordset![PreferredName]
found = True
count = 0
Do While found
pos = InStr(pos + 1, tempName, " ", vbTextCompare)

If pos <> 0 Then
count = count + 1
Else
found = False
End If
Loop

If count > 0 Then
tempArray = Split(tempName, " ")
Else
ReDim tempArray(1)
tempArray(0) = tempName
End If

For i = 0 To blankCount
present(i) = False
Next i

For i = 0 To blankCount
For j = 0 To count
If StrComp(myArray(i), tempArray(j), vbTextCompare) = 0 Then
present(i) = True
End If
Next j
Next i

found = True

For i = 0 To blankCount
If present(i) = False Then
found = False
Exit For
End If
Next i


If found = True Then


recordCount = recordCount + 1 'found record
EmpList.ListItems.Add recordCount, , Str$(recordCount) 'Display Record found into listview"
EmpList.ListItems.Item(recordCount).ListSubItems.Add 1, , Data1.Recordset![PreferredName]
EmpList.ListItems.Item(recordCount).ListSubItems.Add 2, , Data1.Recordset![InternetAdd]
EmpList.ListItems.Item(recordCount).ListSubItems.Add 3, , CStr(Data1.Recordset![PhoneNumber])

tempstring = myString
myString = myString & "" & Data1.Recordset![PreferredName] & " " & CStr(Data1.Recordset![PhoneNumber]) & " " & Data1.Recordset![InternetAdd] & " . "
If Len(myString) > 160 And Option2 <> 0 Then myString = tempstring

End If

Data1.Recordset.MoveNext


Loop
If myString > "" Then

Text2.Text = myString
MSComm1.Output = "AT+CMGD=1,4"
Sleep 100
MSComm1.Output = vbCr
Sleep 100
FromModem$ = ""

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then

Exit Do
End If
End If

Loop





MSComm1.Output = "AT+CMGS=" + num
Sleep 1000
MSComm1.Output = vbCr
Sleep 1000
MSComm1.Output = myString + Chr(26) 'Sent record found via SMS

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then

Sleep 100

Timer1.Enabled = True
Call cmdsearch_Click

Exit Do

End If

End If

Loop

MSComm1.Output = "AT+CMGS=" + num
Sleep 1000
MSComm1.Output = vbCr
Sleep 1000
MSComm1.Output = msg + Chr(26) 'Sent record found via SMS


Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then

Sleep 100

Timer1.Enabled = True
Call cmdsearch_Click

Exit Do

End If

End If

Loop

Else
newlabel.Caption = "Sorry! Record Does Not Exist!"

End If


Text2.Text = "Sorry! Record Does Not Exist!"
MSComm1.Output = "AT+CMGD=1,4"
Sleep 100
MSComm1.Output = vbCr
Sleep 100
FromModem$ = ""

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then


Exit Do
End If
End If

Loop


MSComm1.Output = "AT+CMGS=" + num
Sleep 1000
MSComm1.Output = vbCr
Sleep 1000

MSComm1.Output = "Sorry! Record Does Not Exist!" + Chr(26) 'Reply back to the user 'Sent record found via SMS

Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
Timer1.Enabled = True
Call cmdsearch_Click


Exit Do
End If
End If

Loop

End If

End If


End Sub

Send SMS
Hello,

I'm developing software for a 24/7 production company. If somehow the hardware I'm using (barcode printers / scanners / other RS-232 communication devices) are in error state, the program has to send a SMS to my mobile phone.
I don't know how to start with this one (the SMS part). Anybody can point me in the right direction here?

Thanks,
Patrick

Net Send Help
Is it possible to make a program that will run in the background and if a NET SEND message is sent to your computer, it will prompt you for a password before the message is displayed? I am a BIG TIME newbie so if it is, please put it in really simple terms. I'm just beginning to get into this stuff.

Thanks!
SteveZ

Send To..
Hi all, ive made a file transfer program and i would like to add it to the send to list. what i mean is when you right click on a file a list of choices shows up, things like Open, Copy, Rename and Delete. i want to be able to right click on a file and have my program in the "send to" list so my program opens up as soon as you click the icon

thanks

Yet Again, Net Send
(sorry for any misspelling, english isn't my strong side)

Hello everybody, I am working on a litle project. But have now come up with some problems.. I show my code and talk about the problems later.

Code:
Private Declare Function GetSystemDirectory Lib ”kernel32” Alias ”GetSystemDirectoryA” _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function SendMessage Lib ”user32” Alias ”SendMessageA” _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_FINDSTRING = &H14C
Private Const CB_ERR = (-1)

Private Declare Function PostMessage Lib ”user32” Alias ”PostMessageA” _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const CB_SETCURSEL = &H14E

Private m_bEditFromCode As Boolean
Const MAILSLOT_WAIT_FOREVER = (-1)
Const OPEN_EXISTING = 3
Const GENERIC_READ = &H80000000
Const GENERIC_WRITE = &H40000000
Const GENERIC_EXECUTE = &H20000000
Const GENERIC_ALL = &H10000000
Const INVALID_HANDLE_VALUE = -1
Const FILE_SHARE_READ = &H1
Const FILE_SHARE_WRITE = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
Private Declare Function CloseHandle Lib ”kernel32” (ByVal hHandle As Long) As Long
Private Declare Function WriteFile Lib ”kernel32” _
(ByVal hFileName As Long, ByVal lpBuff As Any, ByVal nNrBytesToWrite As Long, _
lpNrOfBytesWritten As Long, ByVal lpOverlapped As Long) As Long
Private Declare Function CreateFile Lib ”kernel32” Alias ”CreateFileA” _
(ByVal lpFileName As String, ByVal dwAccess As Long, ByVal dwShare As Long, _
ByVal lpSecurityAttrib As Long, ByVal dwCreationDisp As Long, ByVal dwAttributes As Long, _
ByVal hTemplateFile As Long) As Long

Private Sub cmdSend_Click()

For lInd = 1 To Int(nrmsg.Text)
DoEvents
cake = (SendMsg(txtfrom.Text, lstComputers, txtmsg.Text))
DoEvents
Next lInd
End Sub

Function SendMsg(From1 As String, To2 As String, Text3 As String) As Long
Dim rc As Long
Dim mshandle As Long
Dim msgtxt As String
Dim byteswritten As Long
Dim mailslotname As String

mailslotname = ”\” + To2 + ”mailslotmessngr”
msgtxt = From1 + Chr(0) + To2 + Chr(0) + Text3 + Chr(0)
mshandle = CreateFile(mailslotname, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, -1)
rc = WriteFile(mshandle, msgtxt, Len(msgtxt), byteswritten, 0)
rc = CloseHandle(mshandle)
End Function
That was my code, and this is the problems I have been fighting with the past couple of days:

' I want to do so I can write longer messages then usuall, "ordinary" net send only do 160.. thingys, prints on keyboard you know what I mean.

' I'm from Sweden, and we use ÅÄÖ. How can I do so my code supports it? I only get alot of weird "@£€@###" when I send messages with åäö.

' As you see, I want to make a future that allows the user to deside how many messages that will be sent.

For lInd = 1 To Int(nrmsg.Text)
DoEvents
cake = (SendMsg(txtfrom.Text, lstComputers, txtmsg.Text))
DoEvents
Next lInd
End Sub

But if I choose to send 2, it sends 4. If I choose 5, it send 10. It would be great if you could help me with this. I have been googleing like an maniac, but there isn't much on the net with net send av visual basic.
Also, I know i'm not the best VB programmer so if you wanna critic me do it, I love critic on my work.

Thanks all!
Edit by moderator: [vb][/vb] tags make your code much easier to read. Line breaks are also nice.

Net Send API
hi, i need more information on the Net Send API, i know how to send messages already using it, but it will only send messages locally, for instance, i can send a message to 127.0.0.1, but not my external IP address. here is the API i am currently using...


Code:
'API Declarations
Public Declare Function NetMessageBufferSend Lib "netapi32.dll" (ByVal ServerName As String, ByVal msgname As String, ByVal FromName As String, ByVal Buffer As String, ByVal BufSize As Long) As Long
Public Declare Function NetMessageNameAdd Lib "netapi32.dll" ()

Public Function NetSendMessage(sSendTo As String, sMessage As String, Optional ServerName As String = vbNullString, Optional FromName As String = vbNullString) As Long
'convert ANSI strings to UNICODE and send the message
NetSendMessage = NetMessageBufferSend(StrConv(ServerName, vbUnicode), StrConv(sSendTo, vbUnicode), StrConv(FromName & vbNullString, vbUnicode), StrConv(sMessage, vbUnicode), Len(StrConv(sMessage, vbUnicode)))
End Function

if anyone knows any more on this please tell me, thank you.

Net Send API
Pls help me API for NET SEND in windows network.

Thanks & Regards
Mohan A.L

Net Send
does anyone know if a API can control the 'net send' feature usable in MS-DOS across networks? if so would someone be as kind as to tell me, it would be very useful for one of my programs. (saves me having to make tempory batch files, then run then!)

uplink2069

Copyright © 2005-08 www.BigResource.com, All rights reserved