{"id":8228,"date":"2017-03-30T12:45:59","date_gmt":"2017-03-30T03:45:59","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=8228"},"modified":"2017-03-30T13:33:03","modified_gmt":"2017-03-30T04:33:03","slug":"%e6%8c%87%e5%ae%9a%e3%81%97%e3%81%9f%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e5%86%85%e3%81%ae%e7%94%bb%e5%83%8f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e4%b8%80%e6%8b%ac%e6%8c%bf%e5%85%a5%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=8228","title":{"rendered":"\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u633f\u5165\u3059\u308bPowerPoint\u30de\u30af\u30ed"},"content":{"rendered":"<p>\u5927\u91cf\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u30921\u679a\/1\u30b9\u30e9\u30a4\u30c9\u3067\u633f\u5165\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001<\/p>\n<ol>\n<li>\u767d\u7d19\u306e\u30b9\u30e9\u30a4\u30c9\u3092\u8ffd\u52a0\u3057\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u633f\u5165\u3059\u308b\u3002<\/li>\n<li>\u753b\u50cf\u306e\u5927\u304d\u3055\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u5408\u308f\u305b\u308b\u3002<\/li>\n<li>\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306e\u4e0a\u4e0b\u5de6\u53f3\u4e2d\u592e\u306b\u914d\u7f6e\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>\u3068\u3044\u3063\u305f\u4f5c\u696d\u3092\u3044\u3061\u3044\u3061\u624b\u4f5c\u696d\u3067\u884c\u3046\u306e\u306f\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u306e\u3067\u3001\u30de\u30af\u30ed\u3092\u7d44\u3080\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<h4 class=\"style4a\">\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u633f\u5165\u3059\u308bPowerPoint\u30de\u30af\u30ed<\/h4>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub InsertImages()\r\n'\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u633f\u5165\r\n  Dim prs As PowerPoint.Presentation\r\n  Dim sld As PowerPoint.Slide\r\n  Dim shp As PowerPoint.Shape\r\n  Dim tmp As PowerPoint.PpViewType\r\n  Dim fol As Object, f As Object\r\n  Dim fol_path As String\r\n  \r\n  Set prs = ActivePresentation\r\n  \r\n  '\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u8868\u793a\u306b\u306a\u3063\u3066\u3044\u305f\u3089\u89e3\u9664\r\n  If SlideShowWindows.Count &gt; 0 Then prs.SlideShowWindow.View.Exit\r\n  \r\n  With ActiveWindow\r\n    tmp = .ViewType '\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u30e2\u30fc\u30c9\u8a18\u61b6\r\n    .ViewType = ppViewSlide\r\n  End With\r\n  \r\n  '\u753b\u50cf\u30d5\u30a9\u30eb\u30c0\u53d6\u5f97\r\n  Set fol = CreateObject(&quot;Shell.Application&quot;) _\r\n            .BrowseForFolder(0, &quot;\u753b\u50cf\u30d5\u30a9\u30eb\u30c0\u9078\u629e&quot;, &amp;H10, 0)\r\n  If fol Is Nothing Then GoTo Fin\r\n  fol_path = fol.Self.Path\r\n  \r\n  '\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\r\n  With CreateObject(&quot;Scripting.FileSystemObject&quot;)\r\n    If Not .FolderExists(fol_path) Then GoTo Fin\r\n    \r\n    For Each f In .GetFolder(fol_path).Files\r\n      'JPEG\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u51e6\u7406\r\n      Select Case LCase(.GetExtensionName(f.Path))\r\n        Case &quot;jpg&quot;, &quot;jpeg&quot;\r\n          Set sld = prs.Slides.Add(prs.Slides.Count + 1, ppLayoutBlank)\r\n          sld.Select\r\n          Set shp = sld.Shapes.AddPicture(FileName:=f.Path, _\r\n                                          LinkToFile:=False, _\r\n                                          SaveWithDocument:=True, _\r\n                                          Left:=0, _\r\n                                          Top:=0)\r\n          With shp\r\n            .LockAspectRatio = True '\u7e26\u6a2a\u6bd4\u3092\u56fa\u5b9a\r\n            \r\n            '\u633f\u5165\u3057\u305f\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306e\u30b5\u30a4\u30ba\u306b\u5408\u308f\u305b\u308b\r\n            If .Width &gt; .Height Then\r\n              .Width = prs.PageSetup.SlideWidth\r\n            Else\r\n              .Height = prs.PageSetup.SlideHeight\r\n            End If\r\n            \r\n            .Select\r\n          End With\r\n          \r\n          '\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u4e2d\u592e\u306b\u914d\u7f6e\r\n          With ActiveWindow.Selection.ShapeRange\r\n            .Align msoAlignCenters, True\r\n            .Align msoAlignMiddles, True\r\n          End With\r\n      End Select\r\n    Next\r\n  End With\r\nFin:\r\n  ActiveWindow.ViewType = tmp '\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u30e2\u30fc\u30c9\u3092\u5143\u306b\u623b\u3059\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30de\u30af\u30ed\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u304b\u3089\u9078\u629e\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308bJPEG\u30d5\u30a1\u30a4\u30eb\u3092\u3001\u4e00\u62ec\u3067\u30b9\u30e9\u30a4\u30c9\u306b\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerPoint_VBA_InsertImages_01.jpg\" alt=\"\" width=\"585\" height=\"506\" class=\"alignnone size-full wp-image-8229\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerPoint_VBA_InsertImages_01.jpg 585w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerPoint_VBA_InsertImages_01-300x259.jpg 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/p>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"\u5927\u91cf\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u30921\u679a\/1\u30b9\u30e9\u30a4\u30c9\u3067\u633f\u5165\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001 \u767d\u7d19\u306e\u30b9\u30e9\u30a4\u30c9\u3092\u8ffd\u52a0\u3057\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u633f\u5165\u3059\u308b\u3002 \u753b\u50cf\u306e\u5927\u304d\u3055\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u5408\u308f\u305b\u308b\u3002 \u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306e\u4e0a\u4e0b\u5de6\u53f3\u4e2d\u592e\u306b\u914d\u7f6e\u3059\u308b\u3002 \u3068\u3044\u3063\u305f\u4f5c\u696d\u3092\u3044\u3061\u3044\u3061\u624b\u4f5c\u696d\u3067\u884c [&hellip;]","protected":false},"author":1,"featured_media":7126,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u633f\u5165\u3059\u308bPowerPoint\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,58],"tags":[],"class_list":["post-8228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-powerpoint"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-PowerPointVBA.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-28I","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8228"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8228\/revisions"}],"predecessor-version":[{"id":8230,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8228\/revisions\/8230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7126"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}