Results 1 to 9 of 9

Automate sending SMS form MS Access

  1. #1
    Join Date
    Sep 2008
    Posts
    9

    Automate sending SMS form MS Access

    I'm using Outlook 2007. Outlook 2007 provide me function of sending text messages. I want to automate so that I can send the text message from withing MS Access the same as I do with sending and email. But I can't get it to work. The code that I use on the click event of my frmTextMessages send button is the following. My sms gateway is already setup within Outlook 2007 and is the as follow as I can already send text messages from Outlook 2007. I want to automate it with MS Access so that I can send the text message directly from Access.

    SMS gateway
    -------------
    gateway = https://www.vodacommessaging.co.za/oms/service.asmx
    username = johankotze
    password = ******
    -------------

    Code
    ---------------
    Private Sub cmdSend_Click()
    'Set the Outlook controls to create a new message
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(olTextMessage)

    'Set the FROM field
    OutlookMail.SentOnBehalfOfName = strFrom

    'Set the TO field
    If Not IsNull(Me.txtMobileNr) Then
    OutlookMail.To = Me.txtMobileNr
    End If



    'Set the BODY field
    OutlookMail.Body = Me.txtMessage

    'Show the message to the user
    OutlookMail.Send
    MsgBox "SMS has been send successfully!"
    End Sub
    -----------------
    I get a debug error at "OutlookMail.Send"

    Can someone please help me with

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    What does the error say?
    What value does Me.txtMobileNr give you? - If you input this in to an email and press send does it work?
    Other things to tyry:
    Use the same code but hard-writie a phone number that you know works from Outlook.
    Sue the same code but hard-write an email in to make sure that works.

  3. #3
    Join Date
    Sep 2008
    Posts
    9

    Automate sending SMS form MS Access

    Hallo SoftwareMatters
    I attached a example db. I did what you suggest but nothing happens

  4. #4
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    I don't have my Outlook set up to send SMS so I can't do much with your database but I tested it with an email address and the code works.
    Please post the error and I will see if I can decipher it.

  5. #5
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    Try this:
    Put the mobile number in international format i.e. for the uk it would be +447795123456 instead of 07795123456
    then add your domain to the end i.e. your outgoing mail. e.g. 1and1 is auth.smtp.1and1.co.uk so the full mobile number would be:

    +447795123456@1and1.co.uk

  6. #6
    Join Date
    Sep 2008
    Posts
    9
    Hi JD
    I don't understand why I have the cell number must have a domain attached it as my sms gateway is already setup within Outlook 2007. When I want to send an sms from Outlook 2007 I click on the arrow next to New and scroll down to text message that I enter the cell phone number, type te text and send the message via my gateway. All I want to do is when I put the cell phone number and message in my Access form and click on send that whole proccess will be automated as sending an email from within Access. I tried to play with my email code behind the send button of my SMS form but this doesn't working either

    The error that I get "Run-time error -2147467259 (80004005)" "Outlook doesn't recognize one or more names"

  7. #7
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    The error is the same that I get which basically says Oulook doesn't recognise the number as a correct SendTo format.

    When you choose a mobile number and click send in Outlook is anything else added to the number?

    I'm out of ideas i'm afraid but this may help:
    http://www.smsco.it/en/sms_tutorials...rom_access.jsp

  8. #8
    Join Date
    Sep 2008
    Posts
    9
    HI JD
    I only enter the mobile number nothing else is added

  9. #9
    Join Date
    Sep 2008
    Posts
    9
    Hi JD
    I did had a look http://www.smsco.it/en/sms_tutorials...rom_access.jsp but this not what I have in mind. There must be away to automate the sms message from within MS Access the same as if you send it directly fro Outlook 2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automate Excel Import to Access Related Tables
    By KramerJ in forum Programming
    Replies: 6
    Last Post: 04-04-2009, 04:24 PM
  2. Replies: 5
    Last Post: 03-29-2009, 07:20 AM
  3. How to automate a access query ... Help me
    By kusamharsha in forum Programming
    Replies: 0
    Last Post: 02-25-2009, 09:44 AM
  4. Replies: 1
    Last Post: 01-04-2008, 11:40 AM
  5. SENDING EMAIL MESSAGES DIRECTLY FROM ACCESS
    By Frenchos in forum Access
    Replies: 0
    Last Post: 07-20-2007, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums