關鍵功能

  • 批量收郵件及打印
  • 批量發送郵件及有關 I / O 問題
  • 網頁操作

Reference

Excel+VBA常用功能(三):批量发送邮件 - 黄晨的文章 - 知乎
使用Excel+VBA对网页进行操作 - 黄晨的文章 - 知乎
Excel Home 論壇

  1. With CreateObject("internetexplorer.application")
  2. .Visible = True
  3. .Navigate "https://www.baidu.com/s?wd=扯乎"
  4. '关闭网页
  5. ' .Quit
  6. End With

P01) 保存outlook里email的附件

  1. Private Sub CommandButton1_Click()
  2. On Error Resume Next
  3. Dim myolapp As New Outlook.Application
  4. Set fs = CreateObject("Scripting.FileSystemObject")
  5. If Not fs.FolderExists("c:\µÁ◊”” º˛") Then fs.CreateFolder ("c:\µÁ◊”” º˛")
  6. Set myNameSpace = myolapp.GetNamespace("MAPI")
  7. Set myfolder = myNameSpace.GetDefaultFolder(olFolderInbox)
  8. For i = 1 To myfolder.Items.Count
  9. Set mymailitem = myfolder.Items(i)
  10. With mymailitem
  11. Set myAttachments = mymailitem.Attachments
  12. para = myAttachments.Item(1).DisplayName
  13. myAttachments.Item(1).SaveAsFile "c:\µÁ◊”” º˛\" + IIf(IsNull(myAttachments.Item(1).DisplayName), i, myAttachments.Item(1).DisplayName)
  14. End With
  15. Next
  16. MsgBox "±æ≥ÖÚ÷¥––Õͱœ£°«ÎµΩƒø¬º÷–≤Ïø¥∏Ωº˛±£¥Ê«Èøˆ°£", vbDefaultButton1, "Loadhigh”—«È÷–—"
  17. UserForm1.Hide
  18. End Sub