Lights_On

SMS operation similar to Mailto:

37 posts in this topic

Hi All,

 

I have searched but found nothing so hoping someone may know something i can find.

 

I seek to open a new SMS in outlook 2010 like i do an email with shellexecute and  'Mailto:' - is this possible?

 

Share this post


Link to post
Share on other sites



How do you manually open a new SMS in Outlook 2010?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Check out the outlook UDF of Water.

Share this post


Link to post
Share on other sites

Home > New Items > Text Message (SMS)

Share this post


Link to post
Share on other sites
2 minutes ago, water said:

How do you manually open a new SMS in Outlook 2010?

I guess he is doing:  ShellExecute("mailto:mail@server.com")

Share this post


Link to post
Share on other sites
Just now, Juvigy said:

I guess he is doing:  ShellExecute("mailto:mail@server.com")

I want to do something like that - or use a UDF.  But i don't know the equivalent of 'Mailto:' for SMS.

Share this post


Link to post
Share on other sites

I dont have "SMS " on my outlook. Is it some plugin or external application?

Share this post


Link to post
Share on other sites

its built into Outlook you just add the details to configure it.  Unless configured it wont show.  You add it like an email account but select SMS during set up.  I have a separate provider for the account side of things but the SMS is built in native to Outlook - it just requires configuring for it to show.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

It should be possible to do with Outlook COM.
An example in VBS can be found here: https://code.msdn.microsoft.com/office/Outlook-2010-Create-SMS-86f7b716

Edit:
Unfortunately this only works with Oultook 2010.  With Outlook 2013 and later this feature is no longer available.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

Hi Water,

Thank you for this - I shall have a look - it may transpire to be easier for me to just code all into AU3 as i believe i have the providers API.  U shall review shortly.

Thank you.

Share this post


Link to post
Share on other sites

#11 ·  Posted

Should be something like:

#include <OutlookEX.au3>
Global $olMobileItemSMS = 8
Global $oOL = _OL_Open()
; Create an SMS message and provide a body text value.
Global $oItem = _OL_ItemCreate($oOL, $oOL, $olMobileItemSMS, "*", "", "Subject=Test SMS", "Body=Short Message Service (SMS) message from Outlook 2010.")
If @error Then Exit MsgBox(0, "Error", " Error creating item. @error = " & @error & ", @extended = " & @extended)
; Add a recipient
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olOptional, "Contact of the recipient")
If @error Then Exit MsgBox(0, "Error", " Error adding recipient. @error = " & @error & ", @extended = " & @extended)
; Display the Inspector non-modally. 
$oItem.Display()

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

Hi Water - this is very kind - thank you.

 

I have had a try with this and done some reading but no joy yet.  I see why you have used 

$olMobileItemSMS = 8

in the hope that integer 8 is the next Outlook OlLitem enumeration however since your UDF does not support SMS is this not the root as to why it wont work for me? As such would you perhaps suggest I review the UDF code and amend it specifically for the: 

app.CreateItem(olMobileItemMMS)

Thus then perhaps allowing for integer 8 to relate to 'olMobileItemMMS' specifically - or am i 'barking up the wrong tree'?

Share this post


Link to post
Share on other sites

#13 ·  Posted

Do you get any error messages from the script I provided?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

Yes.

 @error is 5 and extended  = 0

Share this post


Link to post
Share on other sites

#15 ·  Posted

My bad. Theres was a typo in my script. Should be:

#include <OutlookEX.au3>
Global $olMobileItemSMS = 8
Global $oOL = _OL_Open()
; Create an SMS message and provide a body text value.
Global $oItem = _OL_ItemCreate($oOL, $olMobileItemSMS, "*", "", "Subject=Test SMS", "Body=Short Message Service (SMS) message from Outlook 2010.")
If @error Then Exit MsgBox(0, "Error", " Error creating item. @error = " & @error & ", @extended = " & @extended)
; Add a recipient
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olOptional, "Contact of the recipient")
If @error Then Exit MsgBox(0, "Error", " Error adding recipient. @error = " & @error & ", @extended = " & @extended)
; Display the Inspector non-modally. 
$oItem.Display()

But I'm not sure this works. The UDF tries to determine the folder where to store the item based on the item type. But - up to now - the UDF does not know the SMS item type and still might return an error.

If you manually send a SMS where does the item get saved? In the sent items Folder like an email?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

Hi Water.

Yes - item gets saved in sent items - it behave the same as an email for all intensive purposes.

sadly revised code still errors but this time:

"Error creating item = @error 4 and extended = -2147352567

Share this post


Link to post
Share on other sites

#17 ·  Posted

Another try:

#include <OutlookEX.au3>
Global $olMobileItemSMS = 8
Global $oOL = _OL_Open()
; Create an SMS message and provide a body text value.
Global $oItem = _OL_ItemCreate($oOL, $olMobileItemSMS, "", "", "Subject=Test SMS", "Body=Short Message Service (SMS) message from Outlook 2010.")
If @error Then Exit MsgBox(0, "Error", " Error creating item. @error = " & @error & ", @extended = " & @extended)
; Add a recipient
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olOptional, "Contact of the recipient")
If @error Then Exit MsgBox(0, "Error", " Error adding recipient. @error = " & @error & ", @extended = " & @extended)
; Display the Inspector non-modally. 
$oItem.Display()

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#18 ·  Posted

@error = 1 with extended = 1 this time :'(

I appricate you help.

Share this post


Link to post
Share on other sites

#19 ·  Posted

The UDF is not able to find a default folder. So we need to specify the folder.

#include <OutlookEX.au3>
Global $olMobileItemSMS = 8
Global $oOL = _OL_Open()
; Create an SMS message and provide a body text value.
Global $oItem = _OL_ItemCreate($oOL, $olMobileItemSMS, "*\Drafts", "", "Subject=Test SMS", "Body=Short Message Service (SMS) message from Outlook 2010.")
If @error Then Exit MsgBox(0, "Error", " Error creating item. @error = " & @error & ", @extended = " & @extended)
; Add a recipient
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olOptional, "Contact of the recipient")
If @error Then Exit MsgBox(0, "Error", " Error adding recipient. @error = " & @error & ", @extended = " & @extended)
; Display the Inspector non-modally. 
$oItem.Display()

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#20 ·  Posted

Still error creating item - sorry ;(

@error = 4 and extended -2147352567

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now