Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Get Sender From Outlook ??

Salam

Aku mau tanya kesemua nih...

Gimana yah caranya ambil email sender dari ms outlook.

aku coba pake script spt ini :

Function GetAttach() As Boolean

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myInbox As Outlook.MAPIFolder
Dim MoveFolder As Outlook.MAPIFolder
Dim oMessage As Object 'Outlook.MailItem


Left(UCase(oMessage.Subject), 7) = "SUBJECT"
'untuk ambil Subject (bisa)
Left(UCase(oMessage.To), 7) = "heppy@"
'untuk ambil To (bisa)

Left(UCase(oMessage.From), 7) = "heppy@"
'kenapa jika aku pake sintax From untuk
ambil sender dari outlook gak bisa ??


script diatas : aku ambil To, CC, Bcc, Subject dan Attachments itu bisa. knapa klo aku pake From gak bisa yah..??

apakah function get sender itu bukan From ..??

thx

Salam
End Function

Comments

  • Pilih References dan select Microsoft Outlook.
    ' Start Outlook.
     ' If it is already running, you'll use the same instance...
       Dim olApp As Outlook.Application
       Set olApp = CreateObject("Outlook.Application")
        
     ' Logon. Doesn't hurt if you are already running and logged on...
       Dim olNs As Outlook.NameSpace
       Set olNs = olApp.GetNamespace("MAPI")
       olNs.Logon
    
     ' Create and Open a new contact.
       Dim olItem As Outlook.ContactItem
       Set olItem = olApp.CreateItem(olContactItem)
    
     ' Setup Contact information...
       With olItem
          .FullName = "James Smith"
          .Birthday = "9/15/1975"
          .CompanyName = "Microsoft"
          .HomeTelephoneNumber = "704-555-8888"
          .Email1Address = "someone@microsoft.com"
          .JobTitle = "Developer"
          .HomeAddress = "111 Main St." & vbCr & "Charlotte, NC 28226"
       End With
       
     ' Save Contact...
       olItem.Save
        
     ' Create a new appointment.
       Dim olAppt As Outlook.AppointmentItem
       Set olAppt = olApp.CreateItem(olAppointmentItem)
        
     ' Set start time for 2-minutes from now...
       olAppt.Start = Now() + (2# / 24# / 60#)
        
     ' Setup other appointment information...
       With olAppt
          .Duration = 60
          .Subject = "Meeting to discuss plans..."
          .Body = "Meeting with " & olItem.FullName & " to discuss plans."
          .Location = "Home Office"
          .ReminderMinutesBeforeStart = 1
          .ReminderSet = True
       End With
        
     ' Save Appointment...
       olAppt.Save
        
     ' Send a message to your new contact.
       Dim olMail As Outlook.MailItem
       Set olMail = olApp.CreateItem(olMailItem)
     ' Fill out & send message...
       olMail.To = olItem.Email1Address
       olMail.Subject = "About our meeting..."
       olMail.Body = _
            "Dear " & olItem.FirstName & ", " & vbCr & vbCr & vbTab & _
            "I'll see you in 2 minutes for our meeting!" & vbCr & vbCr & _
            "Btw: I've added you to my contact list."
       olMail.Send
        
     ' Clean up...
       MsgBox "All done...", vbMsgBoxSetForeground
       olNS.Logoff
       Set olNs = Nothing
       Set olMail = Nothing
       Set olAppt = Nothing
       Set olItem = Nothing
       Set olApp = Nothing
    

    Salam, lewat...:cool:
  • Gak bisa pak,

    Maksudnya saya khan mau ambil alamat email (siapa2 saja yg kirim email ke tmpatku. itu aku baca dari outlook), bukan aku kirim email dari emailku. :)


    thx
Sign In or Register to comment.