Jump to content

add email with attachment button


Pieter Van dijk

Recommended Posts

I want a button with script for creating a mail and add the page as a attachment.

I allready have a script for the mail but i don't know how to add the active page as a attachment in the mail so it can be send within a buttonclick.

Here you can see the script I'm using

import clr

clr.AddReference("System.Windows.Forms")

from System.Windows.Forms import SendKeys

from System.Threading import *

from System.Runtime.InteropServices import Marshal

clr.AddReference("Microsoft.Office.Interop.Outlook")

import Microsoft.Office.Interop.Outlook as outlook

out = Marshal.GetActiveObject("Outlook.Application")

ns=out.GetNamespace("MAPI")

df=outlook.OlDefaultFolders.olFolderOutbox

f = ns.GetDefaultFolder(df);

it=outlook.OlItemType.olMailItem

msg=out.CreateItem(it)

ins=msg.GetInspector

msg.HTMLBody="Title active page"

msg.Subject="Spotfire"

msg.To="email@spotfire.com"

msg.Display(False)

SendKeys.SendWait("%(S)")

SendKeys.SendWait("%(S)")

Link to comment
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
×
×
  • Create New...