Lights_On Posted February 3, 2017 Share 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? Link to comment Share on other sites More sharing options...
water Posted February 3, 2017 Share Posted February 3, 2017 How do you manually open a new SMS in Outlook 2010? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Juvigy Posted February 3, 2017 Share Posted February 3, 2017 Check out the outlook UDF of Water. Link to comment Share on other sites More sharing options...
Lights_On Posted February 3, 2017 Author Share Posted February 3, 2017 Home > New Items > Text Message (SMS) Link to comment Share on other sites More sharing options...
Juvigy Posted February 3, 2017 Share Posted February 3, 2017 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") Link to comment Share on other sites More sharing options...
Lights_On Posted February 3, 2017 Author Share Posted February 3, 2017 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. Link to comment Share on other sites More sharing options...
Juvigy Posted February 3, 2017 Share Posted February 3, 2017 I dont have "SMS " on my outlook. Is it some plugin or external application? Link to comment Share on other sites More sharing options...
Lights_On Posted February 3, 2017 Author Share 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. Link to comment Share on other sites More sharing options...
water Posted February 3, 2017 Share 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: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 3, 2017 Author Share 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. Link to comment Share on other sites More sharing options...
water Posted February 3, 2017 Share 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: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 7, 2017 Author Share 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'? Link to comment Share on other sites More sharing options...
water Posted February 7, 2017 Share Posted February 7, 2017 Do you get any error messages from the script I provided? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 7, 2017 Author Share Posted February 7, 2017 Yes. @error is 5 and extended = 0 Link to comment Share on other sites More sharing options...
water Posted February 7, 2017 Share 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: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 7, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted February 7, 2017 Share 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: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 7, 2017 Author Share Posted February 7, 2017 @error = 1 with extended = 1 this time I appricate you help. Link to comment Share on other sites More sharing options...
water Posted February 7, 2017 Share 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: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Lights_On Posted February 7, 2017 Author Share Posted February 7, 2017 Still error creating item - sorry ;( @error = 4 and extended -2147352567 Link to comment Share on other sites More sharing options...
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