- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 11# justinbaba
§ì¹q¸£ D:\PIC ¥i°Ñ¦Ò ³o¸Ìªº²Ä 5 ©«
Google ®a ¹Ï¤ùªº½d¨Ò- Option Explicit
- Sub Ex_ºô¶¤U¸ü·Ó¤ù()
- Dim i As Integer, E As Object, P As Picture, Sh As Worksheet, MaxWidth As Single
- Set Sh = ActiveSheet '«ü©w¤u§@ªí
- Sh.Pictures.Delete '§R°£©Ò¦³ªº·Ó¤ù
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "https://www.google.com/search?tbm=isch&hl=zh-TW&source=hp&q=%E5%AE%B6&gbv=2&oq=%E5%AE%B6&gs_l=img.12...0.0.0.1844.0.0.0.0.0.0.0.0..0.0....0...1ac..34.img..0.0.0.9S-XuJpg9JY"
- '.Navigate «ü©wªººô¶¦³·Ó¤ù
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- With .Document
- For Each E In .all
- If UCase(E.tagname) = "IMG" Then
- i = i + 1
- Set P = Sh.Pictures.Insert(E.href) 'ª«¥ó(¤u§@ªí¤W·s¼W·Ó¤ù)
- With Sh.Cells(i, "a") '«ü©wªºÀx¦s®æ
- P.Top = .Top '·Ó¤ùªº¥k¤è¦b¤u§@ªí¤Wªº¦ì¸m
- P.Left = .Left '·Ó¤ùªº¥k¤è¦b¤u§@ªí¤Wªº¦ì¸m
- .RowHeight = IIf(P.Height >= 409, 409, P.Height) '½Õ¾ãÀx¦s®æ°ª«×=>·Ó¤ùªº°ª«×
- P.Height = IIf(P.Height >= 409, 409, P.Height) '½Õ¾ãÀx¦s®æ°ª«×=>·Ó¤ùªº°ª«×
- If MaxWidth < P.Width * (.ColumnWidth / .Width) Then '¤U¸ü·Ó¤ùªº³Ì¤j¼e«×
- MaxWidth = P.Width * (.ColumnWidth / .Width)
- .ColumnWidth = P.Width * (.ColumnWidth / .Width) '½Õ¾ãÀx¦s®æÄæ¼e=>·Ó¤ùªº¼e«×
- End If
- End With
- End If
- Next
- End With
- For Each P In Sh.Pictures
- P.Width = Sh.Cells(i, "a").Width '½Õ¾ã©Ò¦³ªº·Ó¤ù¼e«×¤@P
- Next
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|