Manoj Chaurasia Posted March 1, 2015 Share Posted March 1, 2015 Hi All, Please find below the script to send outlook mails through spotfire, modify it according to your need. Please make sure outlook is opened. import clrclr.AddReference("System.Windows.Forms")from System.Windows.Forms import SendKeysfrom System.Threading import *from System.Runtime.InteropServices import Marshalclr.AddReference("Microsoft.Office.Interop.Outlook")import Microsoft.Office.Interop.Outlook as outlook out = Marshal.GetActiveObject("Outlook.Application")ns=out.GetNamespace("MAPI")df=outlook.OlDefaultFolders.olFolderOutboxf = ns.GetDefaultFolder(df); it=outlook.OlItemType.olMailItemmsg=out.CreateItem(it) ins=msg.GetInspectormsg.HTMLBody="hello spotfire training is on"msg.Subject="Spotfire"msg.To="harmeet.singh@gmail.com" msg.Display(False) SendKeys.SendWait("%(S)")SendKeys.SendWait("%(S)") Hope it mails :) Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted March 19, 2015 Author Share Posted March 19, 2015 oh that would be a great help!! Link to comment Share on other sites More sharing options...
veera alavala Posted October 23, 2015 Share Posted October 23, 2015 i am working on a requirement to export an entire page as pdf and send it up to a group in an email, do you have any idea how this can be done in spotfire Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 Yupes its possible check all of my post, wait i will consolidate the script and post Link to comment Share on other sites More sharing options...
christopher sawtelle 2 Posted October 23, 2015 Share Posted October 23, 2015 Cool idea! How do I set the script up in Spotfire to be able to run it Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 you just need a button and set the script :)) Link to comment Share on other sites More sharing options...
christopher sawtelle 2 Posted October 23, 2015 Share Posted October 23, 2015 I'll give it a try!! Link to comment Share on other sites More sharing options...
veera alavala Posted October 23, 2015 Share Posted October 23, 2015 hey harmeet, were you able to figure out consolidated script for exporting a pdf and send the pdf in an email to a group of users Link to comment Share on other sites More sharing options...
sunitha - Posted March 10, 2017 Share Posted March 10, 2017 Hi Harmeet, Your answer is helpful. Thanks. But is there any way we can give outlook credentials here to use instead of keeping outlook open Thanks, Sunitha Link to comment Share on other sites More sharing options...
Vinda G Posted April 6, 2017 Share Posted April 6, 2017 Hi Harmeet, I have tried the above code sending mails through Outlook. Where as it is working fine in Client but not in WebPlayer. I am using Spotfire 7.6.1 Version It throws the below error: Could not add reference to assembly Microsoft.Office.Interop.Outlook at IronPython.Runtime.ClrModule.AddReference(CodeContext context, String name) at IronPython.Runtime.ClrModule.AddReference(CodeContext context, Object reference) at IronPython.Runtime.ClrModule.AddReference(CodeContext context, Object[] references) at _stub_$2622##2622(Closure , CallSite , CodeContext , Object , String ) at Microsoft.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5 target, CallSite site, Object[] args) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at $2629##2629(Closure , Scope , LanguageContext ) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Spotfire.Dxp.Application.ScriptSupport.IronPythonScriptEngine.Execute(ScriptDefinition script, Dictionary`2 scope) at Spotfire.Dxp.Application.Scripting.ScriptService.Execute(ScriptDefinition script, Dictionary`2 scope, InternalLibraryManager internalLibraryManager, NotificationService notificationService) at Spotfire.Dxp.Application.Scripting.ScriptManager.c__DisplayClass4.b__3() at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(Executor executor, Boolean visible, Boolean sticky, Guid stickyGuid) at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(String displayName, Executor executor) at Spotfire.Dxp.Application.Scripting.ManagedScript.Execute(Dictionary`2 environment) at Spotfire.Dxp.Application.HtmlTextAreaControls.ActionControl.ModifyCore(Object value) at Spotfire.Dxp.Application.Visuals.HtmlTextArea.InteractWithControl(String id, Action`1 interaction) Could you please help me in this regard. Link to comment Share on other sites More sharing options...
Ankit Anand 4 Posted August 10, 2017 Share Posted August 10, 2017 Hi Harmeet, Thanks a lot for this script. Unfortunately it doesnt work with Web Player. Do you have a script to make it work for Web Player Regards Link to comment Share on other sites More sharing options...
Brock Meyer DELETE Posted March 28, 2018 Share Posted March 28, 2018 Thanks Link to comment Share on other sites More sharing options...
Brock Meyer DELETE Posted March 28, 2018 Share Posted March 28, 2018 Thank you this is helpful Link to comment Share on other sites More sharing options...
Nikhil Kumar 2 Posted July 24, 2019 Share Posted July 24, 2019 i am also getting same error. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted July 29, 2019 Share Posted July 29, 2019 Check if your NodeManager machine has Outlook installed. When triggerring scripts on WebPlayer they are executed on the NodeManager machine. This script references Outlook so it should be installed on the Node Manager machine 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