{"id":2330,"date":"2012-10-15T16:13:49","date_gmt":"2012-10-15T07:13:49","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2330"},"modified":"2012-10-15T16:13:49","modified_gmt":"2012-10-15T07:13:49","slug":"%e3%82%b9%e3%83%a9%e3%82%a4%e3%83%89%e5%86%85%e5%ae%b9%e3%82%92%e8%87%aa%e5%8b%95%e7%9a%84%e3%81%ab%e6%a9%9f%e6%a2%b0%e7%bf%bb%e8%a8%b3%e3%81%99%e3%82%8bpowerpoint%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2330","title":{"rendered":"\u30b9\u30e9\u30a4\u30c9\u5185\u5bb9\u3092\u81ea\u52d5\u7684\u306b\u6a5f\u68b0\u7ffb\u8a33\u3059\u308bPowerPoint\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"\/\/www.ka-net.org\/blog\/?p=2327\" title=\"\u5404\u30b9\u30e9\u30a4\u30c9\u306b\u914d\u7f6e\u3055\u308c\u305f\u30aa\u30fc\u30c8\u30b7\u30a7\u30a4\u30d7\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308bPowerPoint\u30de\u30af\u30ed\" target=\"_blank\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u7d39\u4ecb\u3057\u305f\u5404\u30b9\u30e9\u30a4\u30c9\u306b\u914d\u7f6e\u3055\u308c\u305f\u30aa\u30fc\u30c8\u30b7\u30a7\u30a4\u30d7\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308bPowerPoint\u30de\u30af\u30ed\u3068\u4ee5\u524d\u7d39\u4ecb\u3057\u305f<a href=\"\/\/www.ka-net.org\/blog\/?p=1274\" title=\"Google\u7ffb\u8a33\u3067\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u30de\u30af\u30ed\" target=\"_blank\">Google\u7ffb\u8a33\u3067\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u30de\u30af\u30ed<\/a>\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30b9\u30e9\u30a4\u30c9\u5185\u5bb9\u3092\u81ea\u52d5\u7684\u306b\u6a5f\u68b0\u7ffb\u8a33\u3059\u308b\u30de\u30af\u30ed\u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n  Dim sld As PowerPoint.Slide\r\n  Dim shp As PowerPoint.Shape\r\n  Dim gshps As PowerPoint.GroupShapes\r\n  Dim tmpsld As PowerPoint.Slide\r\n  Dim tmpvt As PowerPoint.PpViewType\r\n  \r\n  If Application.SlideShowWindows.Count &gt; 0&amp; Then Exit Sub\r\n  tmpvt = Application.ActiveWindow.ViewType\r\n  Application.ActiveWindow.ViewType = ppViewNormal\r\n  Set tmpsld = Application.ActivePresentation.Slides.FindBySlideID _\r\n  (Application.ActivePresentation.Windows(1).Selection.SlideRange.SlideID)\r\n  For Each sld In Application.ActivePresentation.Slides\r\n    For Each shp In sld.Shapes\r\n      Set gshps = Nothing\r\n      On Error Resume Next\r\n      Set gshps = shp.GroupItems\r\n      On Error GoTo 0\r\n      If gshps Is Nothing Then\r\n        SortShape shp\r\n      Else\r\n        SortGroupShape gshps\r\n      End If\r\n    Next\r\n  Next\r\n  tmpsld.Select\r\n  Application.ActiveWindow.ViewType = tmpvt\r\n  Debug.Print &quot;\u51e6\u7406\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot;\r\nEnd Sub\r\n\r\nPrivate Sub SortGroupShape(ByVal gshps As PowerPoint.GroupShapes)\r\n'\u30b0\u30eb\u30fc\u30d7\u5316\u3055\u308c\u305f\u30b7\u30a7\u30a4\u30d7\u306e\u632f\u308a\u5206\u3051\r\n  Dim shp As PowerPoint.Shape\r\n  Dim subgshps As PowerPoint.GroupShapes\r\n  \r\n  For Each shp In gshps\r\n    Set subgshps = Nothing\r\n    On Error Resume Next\r\n    Set subgshps = shp.GroupItems\r\n    On Error GoTo 0\r\n    If subgshps Is Nothing Then\r\n      SortShape shp\r\n    Else\r\n      SortGroupShape subgshps\r\n    End If\r\n  Next\r\nEnd Sub\r\n\r\nPrivate Sub SortShape(ByVal shp As PowerPoint.Shape)\r\n'\u30b7\u30a7\u30a4\u30d7\u306e\u632f\u308a\u5206\u3051\r\n  Dim n As Office.SmartArtNode\r\n  Dim clm As PowerPoint.Column\r\n  Dim c As PowerPoint.Cell\r\n    \r\n  Select Case shp.Type\r\n    Case msoSmartArt\r\n      For Each n In shp.SmartArt.Nodes\r\n        If n.TextFrame2.HasText = True Then MainProcSmartArtNode n\r\n      Next\r\n    Case msoTable\r\n      For Each clm In shp.Table.Columns\r\n        For Each c In clm.Cells\r\n          If c.Shape.TextFrame.HasText = True Then MainProcShape c.Shape\r\n        Next\r\n      Next\r\n    Case Else\r\n      If shp.TextFrame.HasText = True Then MainProcShape shp\r\n  End Select\r\nEnd Sub\r\n\r\nPrivate Sub MainProcShape(ByRef shp As PowerPoint.Shape)\r\n  shp.TextFrame.TextRange.Text = TranslateGoogle(shp.TextFrame.TextRange.Text, &quot;ja&quot;, &quot;en&quot;)\r\nEnd Sub\r\n\r\nPrivate Sub MainProcSmartArtNode(ByRef nd As Office.SmartArtNode)\r\n  nd.TextFrame2.TextRange.Text = TranslateGoogle(nd.TextFrame2.TextRange.Text, &quot;ja&quot;, &quot;en&quot;)\r\nEnd Sub\r\n\r\nPrivate Function TranslateGoogle(ByVal target As String, Optional ByVal FromLng As String = &quot;auto&quot;, Optional ByVal ToLng As String = &quot;en&quot;) As String\r\n  Dim dat As Variant\r\n  Dim ret As String\r\n  Dim js As String\r\n  Dim itm As Object\r\n  Dim cnt As Long\r\n  Dim sentences, length '\u5c0f\u6587\u5b57\u8868\u793a\u7528\u30c0\u30df\u30fc\r\n  Const url As String = &quot;http:\/\/translate.google.com\/translate_a\/t&quot;\r\n  \r\n  ret = &quot;&quot;: js = &quot;&quot;: cnt = 1 '\u521d\u671f\u5316\r\n  dat = &quot;client=0&amp;sl=&quot; &amp; FromLng &amp; &quot;&amp;tl=&quot; &amp; ToLng &amp; &quot;&amp;text=&quot; &amp; EncodeURL(target)\r\n  On Error Resume Next\r\n  With CreateObject(&quot;MSXML2.XMLHTTP&quot;)\r\n    .Open &quot;POST&quot;, url, False\r\n    .setRequestHeader &quot;Content-Type&quot;, &quot;application\/x-www-form-urlencoded;charset=UTF-8&quot;\r\n    .Send dat\r\n    If .Status = 200 Then js = .responseText\r\n  End With\r\n  On Error GoTo 0\r\n  If Len(js) &gt; 0 Then\r\n    js = &quot;(&quot; &amp; js &amp; &quot;)&quot;\r\n    With CreateObject(&quot;ScriptControl&quot;)\r\n      .Language = &quot;JScript&quot;\r\n      On Error Resume Next\r\n      For Each itm In .CodeObject.eval(js).sentences\r\n        If cnt = 1 Then\r\n          ret = ret &amp; itm.trans\r\n        Else\r\n          ret = ret &amp; vbCrLf &amp; itm.trans\r\n        End If\r\n        cnt = cnt + 1\r\n      Next\r\n      On Error GoTo 0\r\n    End With\r\n  End If\r\n  TranslateGoogle = ret\r\nEnd Function\r\n\r\nPrivate Function EncodeURL(ByVal sWord As String) As String\r\n  With CreateObject(&quot;ScriptControl&quot;)\r\n    .Language = &quot;JScript&quot;\r\n    EncodeURL = .CodeObject.encodeURIComponent(sWord)\r\n  End With\r\nEnd Function<\/pre>\n<p>\u30b3\u30fc\u30c9\u81ea\u4f53\u306f\u4e0a\u8a18\u8a18\u4e8b\u4e2d\u306e\u30de\u30af\u30ed\u3092\u307b\u307c\u305d\u306e\u307e\u307e\u6d41\u7528\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001\u30b0\u30e9\u30d5\u306b\u3064\u3044\u3066\u306f\u51e6\u7406\u304c\u8907\u96d1\u306b\u306a\u308b\u306e\u3067\u4eca\u56de\u306f\u7121\u8996\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u4e0b\u56f3\u306e\u3088\u3046\u306a\u65e5\u672c\u8a9e\u306e\u30b9\u30e9\u30a4\u30c9\u304c\u3001<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01-300x214.jpg\" alt=\"\" title=\"PptTranslate_01\" width=\"300\" height=\"214\" class=\"alignnone size-medium wp-image-2331\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01-300x214.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01-290x207.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01-150x107.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_01.jpg 1023w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u81ea\u52d5\u7684\u306b\u7ffb\u8a33\u304c\u884c\u308f\u308c\u3059\u3050\u306b\u82f1\u8a9e\u306e\u30b9\u30e9\u30a4\u30c9\u3078\u3068\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02-300x214.jpg\" alt=\"\" title=\"PptTranslate_02\" width=\"300\" height=\"214\" class=\"alignnone size-medium wp-image-2332\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02-300x214.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02-290x207.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02-150x107.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PptTranslate_02.jpg 1023w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u7ffb\u8a33\u306f\u3059\u3079\u3066<a href=\"http:\/\/translate.google.com\/\" title=\"Google\u7ffb\u8a33\" target=\"_blank\">Google\u7ffb\u8a33<\/a>\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u540c\u30b5\u30fc\u30d3\u30b9\u304c\u4f7f\u7528\u3067\u304d\u306a\u304f\u306a\u308b\u3068\u4e0a\u8a18\u30de\u30af\u30ed\u3082\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n<span style=\"color: #ff0000; font-weight: bold;\">\u534a\u3070\u7121\u7406\u3084\u308a\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u696d\u52d9\u7528\u3084\u305d\u306e\u4ed6\u91cd\u8981\u306a\u30de\u30af\u30ed\u306e\u4e2d\u306b\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306f\u304a\u85a6\u3081\u3057\u307e\u305b\u3093(\u7ffb\u8a33\u7cbe\u5ea6\u306b\u3064\u3044\u3066\u3082\u79c1\u306f\u4e00\u5207\u4fdd\u8a3c\u3057\u307e\u305b\u3093)\u3002<\/span><br \/>\n\u3042\u304f\u307e\u3067\u3082\u3001\u3053\u3046\u3044\u3063\u305f\u3053\u3068\u3082\u4e00\u5fdc\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u53c2\u8003\u7a0b\u5ea6\u306b\u7559\u3081\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u5404\u30b9\u30e9\u30a4\u30c9\u306b\u914d\u7f6e\u3055\u308c\u305f\u30aa\u30fc\u30c8\u30b7\u30a7\u30a4\u30d7\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308bPowerPoint\u30de\u30af\u30ed\u3068\u4ee5\u524d\u7d39\u4ecb\u3057\u305fGoogle\u7ffb\u8a33\u3067\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u30de\u30af\u30ed\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30b9\u30e9\u30a4\u30c9\u5185\u5bb9\u3092\u81ea\u52d5\u7684\u306b\u6a5f\u68b0\u7ffb\u8a33\u3059\u308b\u30de\u30af\u30ed\u3092\u4f5c\u3063 [&hellip;]","protected":false},"author":1,"featured_media":7125,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,58],"tags":[90,91],"class_list":["post-2330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-powerpoint","tag-powerpoint-vba","tag-powerpoint-"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-PowerPoint.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-BA","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2330","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=2330"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":2335,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2330\/revisions\/2335"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7125"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}