VBA for SMS

abbaddon223

Registered User.
Local time
Today, 11:11
Joined
Mar 13, 2010
Messages
162
Hi all,

I have the below code that will create an outlook event and populate the fields as required. I'm trying to modify this so that instead of opening an email outlook event, it opens an SMS event (I've got the add in installed).

Private Sub Command127_Click()
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
Dim OlkRecip As Outlook.Recipient
Set OlkRecip = .Recipients.Add(Me![Mobile])
OlkRecip.Type = SMS


.Subject = "Shift Confirmation"
On Error Resume Next
.Body = Me![SMSNote]
.Display

End With
Set Olk = Nothing
Set OlkMsg = Nothing
Set OlkRecip = Nothing
End Sub

All the fields should be fine, its just how to open the SMS.

Thanks all in advance.
 
I can't say that I've tried this, but you did peek my interest enough to find the following post (http://www.tek-tips.com/viewthread.cfm?qid=1607993&page=1)

<code>
Sub MyCreateFromTemplate()
On Error Resume Next
Dim myOlApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Dim strPF As String
Dim strOFT As String

Set myOlApp = CreateObject("Outlook.Application")
strPF = "C:\Program Files\Microsoft Office\Microsoft Office Outlook SMS Add-in\"
strOFT = "sms.oft"
Set MyItem = myOlApp.CreateItemFromTemplate(strPF & strOFT)
MyItem.Subject = "Subject"
MyItem.Body = "Body"

MyItem.To = "xxxx"
'
'xxxx is a legal phone number ???? how to fill?)
'?? something like MyItem.recipents.add ("xxxx")
'
MyItem.Save
MyItem.Send

End Sub
</code>

This is not a complete example, but does show that others are working on the same problem.

I hope this helps a tiny bit.
________
Ford Towcommand
 
Last edited:
Thanks for that - I'll give it a try
 

Users who are viewing this thread

Back
Top Bottom