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

[µo°Ý] VBA outlook ¹Ï¤ù¤å¶¹Ïµ{¦¡½X

[µo°Ý] VBA outlook ¹Ï¤ù¤å¶¹Ïµ{¦¡½X

¥H¤Uµ{¦¡½X§@¥Î¬O±Nexcel½d³ò¡A¶K¦Üoutlook«H¥ó¤º¤å¹Ï¤ù¡A¨Ã³]©w¹Ï¤ù¤j¤p¡C
¦ýºô¸ô¤W§Ú§ä¤£¨ì¡u¤å¶¹Ï¡vªºµ{¦¡½X¡A·Q½Ð±Ð¦pªG§Ú·Q³]©w¹Ï¤ùªº¤å¶¹Ï¬°¡u¤W¤Î¤U¡v¡A¬O§_¦³VBAµ{¦¡½X¥i¹F¦¨¡HÁÂÁ¡ã

Sub test()
Dim wordDoc As Object

Range("B2:H8").Select
Selection.Copy

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

With OutMail
    .To = ""
    .Subject = ""
    .Display
   
    Set wordDoc = OutMail.GetInspector.WordEditor
    wordDoc.Range(Start:=0, End:=1).PasteAndFormat 13
    wordDoc.InlineShapes(1).LockAspectRatio = msoFalse
    wordDoc.InlineShapes(1).Height = 5 * 28.35
    wordDoc.InlineShapes(1).Width = 16 * 28.35

End With

End Sub
*¦v¤k¤@ªTµL»~*

¥H¤Uµ{¦¡½X§@¥Î¬O±Nexcel½d³ò¡A¶K¦Üoutlook«H¥ó¤º¤å¹Ï¤ù¡A¨Ã³]©w¹Ï¤ù¤j¤p¡C
¦ýºô¸ô¤W§Ú§ä¤£¨ì¡u¤å¶¹Ï¡vªº ...
msmplay µoªí©ó 2022-10-6 11:21



    ¥i¥H°Ñ¦Ò·L³nªº code
     https://learn.microsoft.com/zh-t ... ons.picturewraptype

¥t¥~... ±zªºcode ¬Owordªº§a... «ç·|¶]¨ìexcel....@@

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 1# msmplay


¥H¤U³o¬q§ï¤@¤U ¸Õ¸Õ¬Ý
Range("B2:H8").Select
Selection.Copy

¦Û¤v§ï¤@¤U§a  ³o¬O¤§«e¦b³o¸Ì§ä¨ìªº  ¬Y¦ì«e½ú¼gªº §Ñ¤F¦b­þ¤@­¶¤F ¤w¸g«Ü¤[¤F
  1. Public Sub §âÀx¦s®æ¤º®e¦s¦¨ÀÉ®×()

  2.     Range("A1:A12").CopyPicture 1, 2
  3.     Range("A1").Select
  4.     ActiveSheet.Paste
  5.     'Åã¥Ü¹Ï¤ù©Î«ö¶s¦WºÙ
  6.     For Each Shp In ActiveSheet.Shapes
  7.     Debug.Print Shp.Name
  8.         If Left(Shp.Name, 7) = "Picture" Then
  9.             Shp.Copy
  10.             With ActiveSheet
  11.                 Set Cht = .ChartObjects.Add(0, 0, Shp.Width + 5, Shp.Height + 5)
  12.                 '±NShapeªº¹Ï¤ù¶K¤W¹Ïªíª«¥ó¤¤
  13.                 With Cht
  14.                     .Border.LineStyle = 0
  15.                     .Chart.Paste
  16.                     '¦b¨Ï¥ÎExport¤èªk, ¹Ïªí¶×¥X¦¨JPG¹ÏÀÉ
  17.                     .Chart.Export "C:\Users\a5525\Desktop\EXCELªºxlsmÀÉ®×\888.jpg"             ', filtername:="JPG"
  18.                     '§R°£¹Ïªí
  19.                     .Delete
  20.                 End With
  21.             End With
  22.         End If
  23.     Next Shp

  24. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD