Jump to content

Recommended Posts

Posted

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?

 

Posted

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

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

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.

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:

  Reveal hidden contents

 

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.

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:

  Reveal hidden contents

 

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'?

Posted

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

My UDFs and Tutorials:

  Reveal hidden contents

 

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:

  Reveal hidden contents

 

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

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:

  Reveal hidden contents

 

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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...