'목록하단 광고 치환자(withSeok)
728x90

 

엑사남님 VBA 실무 전역변수 관련 따라하기
sub 메일관련모듈

Dim OutAPpp As Object
DIm OutItem As outlook.MailItem

Set OutApp = New Outlook.Application
Set OutItem = OutApp.CreatItem(olMailItem)
    
    Call PDF_Save

    With OutItem
        .To = "AAA@bbb.com"
        .CC = ""
        .BCC = ""
        .Subject = "첨부파일 테스트 메일"
        .Body = "첨부파일 첨부하여 메일 발송하기"
        .Attachments.Add strSave
        .Send
    End With

Set OutItem = Nothing
Set OutApp = Nothing


end sub
Public strSave As String
Sub PDF_Save()

Dim strPath As String
Dim strFile As String

    strPath = "C:\User\Withseok\Desktop\"
    strFile = "테스트PDF_" & "Format(Date, "YYYMMDD")
    strSave = strPath & strFile & ".pdf"

    Sheet1.ExportAsFixedFormat _
             Type:=xlTypePDF, _
             Filename:=strSave, _
             Quality:=xlQualityStandard, _
             IncludeDocProperties:=True, _
             IgnorePrintAreas:=False, _
             OpenAfterPublish:=False, _
    Sheet1.DisplayPageBreaks = False

End Sub

 

728x90

+ Recent posts