ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Notesªºªí®æÄæ¦ì¼e«×¤£¦P©óExcelªºÄæ¦ì¼e«×ªº°ÝÃD

[µo°Ý] Notesªºªí®æÄæ¦ì¼e«×¤£¦P©óExcelªºÄæ¦ì¼e«×ªº°ÝÃD

Hello, ¦U¦ì¤j¤j

¦p¤Uµ{¦¡¬q¸Ìªº¬õ¦r, ¨äExcel¸ê®ÆÂà¶Kªº¤è¦¡¦ÜNotes¸Ì,
¦ý±`·|¦³®æ¦¡¶]±¼(Notesªºªí®æÄæ¦ì¼e«×¤£¦P©óExcelªºÄæ¦ì¼e«×)ªº°ÝÃD.
¬G¤£ª¾¦³¨S¦³«ü¥O¥i¥H±N¨äªí®æÂର"¹Ï¤ù¼Ò¦¡" ¦ÜNotes¤W.
©Î¬O¦³¨ä¥Lªº¤è¦¡, ÅýNotes¤Wªºªí®æ¼e«×»PExcel¬Û¦P?!
Thanks ~

[[µ{¦¡¬q]]
       Dim es As Object
       Dim at As Object
       Dim Work As Object
       Dim oc As Object
       Dim doc As Object
       Dim strMsg As String
       Dim UserName As String 'The current users notes name
       Dim MailDbName As String 'THe current users notes mail database name
       Dim dbleCPRow As Double
                     
       Set es = CreateObject("Notes.NotesSession")
       Set Work = CreateObject("Notes.NotesUIWorkspace")
        
       UserName = es.UserName
       MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
               
       Set at = es.GetDataBase(vbNullString, MailDbName)
       If Not at.IsOpen Then
          at.OPENMAIL
       Else
          MsgBox "Mail Open Fail..!"
       End If
        
       Set oc = at.CreateDocument
       With oc
            .Form = "Memo"
            .sendto = "david"  
            .Subject = "Mail Sending Try..."
       End With
                                
       dblCPRow = Application.WorksheetFunction.CountIf(Range("$H$3:$H$666"), "<>") + 2   ' +2 is report title ignored
      
       Set doc = Work.EDITDocument(True, oc)
       With doc
             .InsertText ("<< Mail autot Sending >> ")
            Range("A2:K" & dblCPRow).Copy
            .Paste                                 ===>> §Ú¦p¦ó¨Ï¥Î¦pPasteSpecial«ü¤µ, ±N¨ä­ÈÂର "¹Ï¤ù" ¶K¦ÜNotesl¸Ì.
            Application.CutCopyMode = False
            .send
            .Close
       End With
       Set es = Nothing
       Set at = Nothing
       Set Work = Nothing
       Set oc = Nothing
       Set doc = Nothing

       MsgBox "Mail had been sent..!"
·s¤â¤W¸ô¡A½Ð¦h¥]²[¡C

Hello, All

¦p¤U©Ò¥Ü, §Ú§ä¨ì¤F¤@­Ó¤gªk½m¿ûªº¤è¦¡!!
§Y¦bExcel¤º±Nªí®æÂର¹Ï¤ù, µM«á¦A±N¦¹¹Ï¤ùÂà¶K¦ÜIBM Notes¸Ì,
³Ì«á¦A±N²£¥Íªº¹Ï¤ù§R°£, §Y¥i.
¦p¦¹¤@¨Ó, °£«DTargetºÝ¤£±µ¨ü¹Ï¤ù, §_«h´N¤£¥Î¥h¦Ò¼{¨ä¬O¤°»ò®æ¦¡¤F!!
»P¤j¹Ù¤À¨É.....Thanks ~~


[[µ{¦¡¬q]]
        Dim es As Object
        Dim at As Object
        Dim Work As Object
        Dim oc As Object
        Dim doc As Object
        Dim rgPic As Range
        Dim strMsg As String
        Dim UserName As String 'The current users notes name
        Dim MailDbName As String 'THe current users notes mail database name
        Dim dbleCPRow As Double
                       
        Set es = CreateObject("Notes.NotesSession")
        Set Work = CreateObject("Notes.NotesUIWorkspace")
         
        UserName = es.UserName
        MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
                 
        Set at = es.GetDataBase(vbNullString, MailDbName)
        If Not at.IsOpen Then
           at.OPENMAIL
        Else
           MsgBox "Mail Open Fail..!"
        End If
         
        Set oc = at.CreateDocument
        With oc
             .Form = "Memo"
             .sendto = "david"  
             .Subject = "Mail Sending Try..."
        End With
                                 
        dblCPRow = Application.WorksheetFunction.CountIf(Range("$H$3H$666"), "<>") + 2   ' +2 is report title ignored
        
        Set doc = Work.EDITDocument(True, oc)
        With doc
              .InsertText ("<< Mail autot Sending >> " & vbNewLine )
             Set rgPic = Range("A2:K" & dblCPRow)
            rgPic.CopyPicture Appearance:=xlScreen, Format:=xlPrinter     ' Trans Excel Table to Picture mode.
            With ActiveSheet.ChartObjects.Add(Left:=rgPic.Left, Top:=rgPic.Top, Width:=rgPic.Width, Height:=rgPic.Height)           ' Set Picture name to tmpChart
                   .Name = "tmpChart"
                   .Activate
             End With
            .Paste
            Application.CutCopyMode = False
           ActiveSheet.ChartObjects("tmpChart").Delete         ' Delete this template chart.
             .send
             .Close
        End With
        Set es = Nothing
        Set at = Nothing
        Set Work = Nothing
        Set oc = Nothing
        Set doc = Nothing
        set rgPic =Nothing

        MsgBox "Mail had been sent..!"
·s¤â¤W¸ô¡A½Ð¦h¥]²[¡C

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD