Lights_On Posted February 3, 2017 Posted February 3, 2017 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?
water Posted February 3, 2017 Posted February 3, 2017 How do you manually open a new SMS in Outlook 2010? My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 3, 2017 Author Posted February 3, 2017 Home > New Items > Text Message (SMS)
Juvigy Posted February 3, 2017 Posted February 3, 2017 On 2/3/2017 at 9:34 AM, water said: How do you manually open a new SMS in Outlook 2010? Expand I guess he is doing: ShellExecute("mailto:mail@server.com")
Lights_On Posted February 3, 2017 Author Posted February 3, 2017 On 2/3/2017 at 9:37 AM, Juvigy said: I guess he is doing: ShellExecute("mailto:mail@server.com") Expand I want to do something like that - or use a UDF. But i don't know the equivalent of 'Mailto:' for SMS.
Juvigy Posted February 3, 2017 Posted February 3, 2017 I dont have "SMS " on my outlook. Is it some plugin or external application?
Lights_On Posted February 3, 2017 Author Posted February 3, 2017 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.
water Posted February 3, 2017 Posted February 3, 2017 (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 February 3, 2017 by water My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 3, 2017 Author Posted February 3, 2017 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.
water Posted February 3, 2017 Posted February 3, 2017 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 UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 7, 2017 Author Posted February 7, 2017 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'?
water Posted February 7, 2017 Posted February 7, 2017 Do you get any error messages from the script I provided? My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted February 7, 2017 Posted February 7, 2017 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 UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 7, 2017 Author Posted February 7, 2017 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
water Posted February 7, 2017 Posted February 7, 2017 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 UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 7, 2017 Author Posted February 7, 2017 @error = 1 with extended = 1 this time I appricate you help.
water Posted February 7, 2017 Posted February 7, 2017 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 UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lights_On Posted February 7, 2017 Author Posted February 7, 2017 Still error creating item - sorry ;( @error = 4 and extended -2147352567
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now