我在outlook中有一个现有的表单,我需要为它创建一个宏。它是一个用于向我们公司办公室提交数据的组织。每次,我都要填写我的员工编号,地址,头等和最后等...有人可以帮我创建一个宏来填写这些字段,这样我就不必每次都复制,粘贴或输入我的信息了吗?谢谢!
答案 0 :(得分:0)
This HTML email creater. Insert this into the "Visual Basic Editor in Tools>Macro then run the
macro "emailpictures". It will ask for validation.
Sub emailpicture()
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOutlookRecip = objOutlookMsg.Recipients.Add("companyemail@email.com")
objOutlookRecip.Type = olTo
objOutlookMsg.Subject = "Picture"
' add "C:\picture.png as attachment to Outlook message
Set colAttach = objOutlookMsg.Attachments
Set l_Attach = colAttach.Add("C:\path\image.jpg")
' Dereference the attachment objects before changing their properties via CDO
Set colAttach = Nothing
Set l_Attach = Nothing
'Set body format to HTML
objOutlookMsg.BodyFormat = olFormatHTML
objOutlookMsg.HTMLBody = "<HTML><head></head><BODY><center><table><tr><td><center><h1>Title </h1></center></td></tr><tr><td><center><h1>Body</h1></center><br /></td></tr><img src=""image.jpg"" alt=image><br /><br /></td></tr><tr><td><center><h3>Hope you will have a worderous day!</h3></center><br /><br /></td></tr><tr><td><center><h3>From</h3></center><br /><br /></td></tr></table></center></BODY></HTML>"
objOutlookMsg.Send
Set objOutlookRecip = Nothing
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
答案 1 :(得分:0)
子emailfromexcel() Dim OutApp As Object 昏暗的OutMail作为对象 设置OutApp = CreateObject(“Outlook.Application”) 设置OutMail = OutApp.CreateItem(0) 随着OutMail .To =“person@email.com” .BCC = thebcc .Subject =“这个主题” .Body =“这个身体” 。显示 。发送 结束 设置OutMail =没什么 设置OutApp = Nothing 结束子
答案 2 :(得分:0)
Sub emailfromexcel()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "person@email.com"
.BCC = thebcc
.Subject = "This subject"
.Body = "This body"
.Display
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub