We help IT Professionals succeed at work.
Get Started

Sending Text Message to Mobile Phone from Access 2010 Application

1,256 Views
Last Modified: 2016-02-11
I have developed an Access Database application that includes Names, Email Addresses, Mobile Phones etc.....
I use the code shown below (please scroll) to launch Outlook 2010, and provide the Email Address and pre determined text and subject.  The user then Clicks "Send" in outlook to send the message.

I want to use http://www.smsofficer.com/ to send the same message to a Mobile Phone (from the database).  If you click this Link and watch the Demo, all that is needed is to "tell" Outlook to send this message as a text Message instead on an Email message.

Question:  How to I modify the ACCESS VBA code shown below, so that the user does not have to manually select "Text Message", before clicking "Send"?

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

          Dim dbs As Database
         
          Set dbs = CurrentDb

          ' Create the Outlook session.
         
          Set objOutlook = New Outlook.Application

          ' Create the message.
          Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

          With objOutlookMsg
              ' Add the To recipient(s) to the message.
                Set objOutlookRecip = .Recipients.Add(strEmailTo)
                objOutlookRecip.Type = olTo

            If Not IsNull(strEmailSubject) And strEmailText <> "" Then
             ' Set the Subject, Body,
                .Subject = strEmailSubject
            End If
           
            If Not IsNull(strEmailText) And strEmailText <> "" Then
                .Body = strEmailText & vbCrLf & vbCrLf
                .Importance = olImportanceHigh  'High importance
            End If

             ' Resolve each Recipient's name.
            For Each objOutlookRecip In .Recipients
                 objOutlookRecip.Resolve
            Next

                 .Display

        End With
        Set objOutlook = Nothing
Exit Sub


Thanks for your help!
Comment
Watch Question
President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE