2013-06-06 3 views
0

Outlook 용 매크로를 만들 필요가있는 기존 양식이 있습니다. 본사 사무실에 데이터를 제출하는 데 사용되는 양식입니다. 매번 직원 번호, 주소, 성 등을 기입해야합니다 ... 누군가가이 필드를 채우기 위해 매크로를 작성하도록 도와주기 때문에 매번 내 정보를 복사하여 붙여 넣거나 입력 할 필요가 없습니까? 감사!Outlook 2003 양식 매크로

+0

당신이 디자인을 편집 할 수있는 형태가 있다면 하위 = 아무것도 설정 OutApp = 아무것도 끝 설정 OutMail와 엔드 및 기본값에 넣어? – JimmyPena

답변

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("[email protected]") 
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 

최종 하위

객체 설정 OutApp = CreateObject를 ("으로 Outlook.Application")으로 객체 희미한 OutMail으로
0

하위 emailfromexcel() 희미한 OutApp 설정 OutMail = OutApp.CreateItem (0) OutMail .TO = "[email protected]" .BCC = thebcc .Subject = "이 제목이" .Body = "이 몸" .Display .Send로

0
Sub emailfromexcel() 
    Dim OutApp As Object 
    Dim OutMail As Object 
    Set OutApp = CreateObject("Outlook.Application") 
    Set OutMail = OutApp.CreateItem(0) 
    With OutMail 
    .To = "[email protected]" 
    .BCC = thebcc 
    .Subject = "This subject" 
    .Body = "This body" 
    .Display 
    .Send 
    End With 
    Set OutMail = Nothing 
    Set OutApp = Nothing 
    End Sub 
관련 문제