{"id":4386,"date":"2014-04-10T16:33:53","date_gmt":"2014-04-10T07:33:53","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4386"},"modified":"2014-04-10T16:33:53","modified_gmt":"2014-04-10T07:33:53","slug":"%e9%96%b2%e8%a6%a7%e3%83%97%e3%83%ac%e3%83%93%e3%83%a5%e3%83%bc%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%81%ae%e9%81%b8%e6%8a%9e%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e5%8f%96%e5%be%97%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4386","title":{"rendered":"\u95b2\u89a7(\u30d7\u30ec\u30d3\u30e5\u30fc)\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u9078\u629e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3059\u308bOutlook\u30de\u30af\u30ed"},"content":{"rendered":"<p>Microsoft Community\u306b\u3042\u3063\u305f\u8cea\u554f\u300c<a href=\"http:\/\/answers.microsoft.com\/thread\/7c78b032-47c3-4ba4-8329-1bac25c4e344\" title=\"Outlook\u306e\u95b2\u89a7\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u30e1\u30fc\u30eb\u306e\u4e00\u90e8\uff08\u9078\u629e\u72b6\u614b\u306e\u3082\u306e\uff09\u3092VBA\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\" target=\"_blank\">Outlook\u306e\u95b2\u89a7\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u30e1\u30fc\u30eb\u306e\u4e00\u90e8\uff08\u9078\u629e\u72b6\u614b\u306e\u3082\u306e\uff09\u3092VBA\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/a>\u300d\u3078\u306e\u56de\u7b54\u3068\u3057\u3066\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u306f32\u30d3\u30c3\u30c8\u7248\u306eOffice 2010\u3067\u691c\u8a3c\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/span><br \/>\n<span style=\"color: #ff0000; font-weight: bold;\">\u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u306fVBE\u304b\u3089\u5b9f\u884c\u3059\u308b\u3068\u4e0a\u624b\u304f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/span><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate Declare Function GetFocus Lib &quot;user32&quot; () As Long\r\nPrivate Declare Function GetClassName Lib &quot;user32&quot; Alias &quot;GetClassNameA&quot; (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long\r\nPrivate Declare Function GetWindowText Lib &quot;user32&quot; Alias &quot;GetWindowTextA&quot; (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long\r\n\r\nPublic Sub Sample()\r\n  Dim s As String\r\n  \r\n  s = GetSelectedTextFromReadingPane()\r\n  If Len(Trim(s)) &gt; 0 Then MsgBox s\r\nEnd Sub\r\n\r\nPrivate Function GetSelectedTextFromReadingPane() As String\r\n'\u95b2\u89a7(\u30d7\u30ec\u30d3\u30e5\u30fc)\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u9078\u629e\u6587\u5b57\u5217\u3092\u53d6\u5f97\r\n  Dim h As Long\r\n  Dim clsName As String\r\n  Dim clsBuf As String * 255\r\n  Dim winName As String\r\n  Dim winBuf As String * 255\r\n  Dim ret As String\r\n  \r\n  ret = &quot;&quot; '\u521d\u671f\u5316\r\n  With Application.ActiveExplorer\r\n    If .IsPaneVisible(olPreview) = True Then\r\n      h = GetFocus()\r\n      GetClassName h, clsBuf, Len(clsBuf)\r\n      clsName = Left$(clsBuf, InStr(clsBuf, vbNullChar) - 1)\r\n      GetWindowText h, winBuf, Len(winBuf)\r\n      winName = Left$(winBuf, InStr(winBuf, vbNullChar) - 1)\r\n      If clsName = &quot;_WwG&quot; And winName = &quot;\u30e1\u30c3\u30bb\u30fc\u30b8&quot; Then\r\n        '&quot;\u30b3\u30d4\u30fc&quot;\u306e\u6709\u52b9\u30fb\u7121\u52b9\u5224\u5225\r\n        If .CommandBars.FindControl(ID:=19).Enabled = True Then\r\n          .CommandBars.FindControl(ID:=19).Execute\r\n          ret = CreateObject(&quot;htmlfile&quot;).parentWindow.clipboardData.getData(&quot;text&quot;) '\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u304b\u3089\u6587\u5b57\u5217\u53d6\u5f97\r\n        End If\r\n      End If\r\n    End If\r\n  End With\r\n  GetSelectedTextFromReadingPane = ret\r\nEnd Function<\/pre>\n<p>Outlook\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u773a\u3081\u3066\u307f\u3066\u3082\u3001\u95b2\u89a7\u30a6\u30a3\u30f3\u30c9\u30a6\u304b\u3089\u76f4\u63a5\u9078\u629e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306a\u30e1\u30bd\u30c3\u30c9\u3084\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u898b\u3064\u3051\u3089\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\u3088\u3046\u306a\u65b9\u6cd5\u3092\u3068\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u5f8c\u306b\u306a\u3063\u3066\u8abf\u3079\u305f\u3068\u3053\u308d\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u3068\u4f3c\u305f\u3088\u3046\u306a\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u305f\u8cea\u554f\u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u30fbHow do I get the selected Text from the reading pane in Outlook 2003?<\/strong><br \/>\n<a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-us\/7f40c0d0-203b-44fb-ad8a-ce134f793563\/\" title=\"How do I get the selected Text from the reading pane in Outlook 2003?\" target=\"_blank\">http:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-us\/7f40c0d0-203b-44fb-ad8a-ce134f793563\/<\/a><\/p>\n<p>\u300c<a href=\"http:\/\/www.add-in-express.com\/forum\/read.php?FID=5&#038;TID=6922\" title=\"Selected text - Outlook's reading pane - Add-in Express .NET forum\" target=\"_blank\">Selected text &#8211; Outlook&#8217;s reading pane<\/a>\u300d\u306b\u3082\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001Outlook\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30e2\u30c7\u30eb\u306b\u306f\u3001\u95b2\u89a7\u30a6\u30a3\u30f3\u30c9\u30a6\u304b\u3089\u9078\u629e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306a\u3082\u306e\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Microsoft Community\u306b\u3042\u3063\u305f\u8cea\u554f\u300cOutlook\u306e\u95b2\u89a7\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u30e1\u30fc\u30eb\u306e\u4e00\u90e8\uff08\u9078\u629e\u72b6\u614b\u306e\u3082\u306e\uff09\u3092VBA\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u300d\u3078\u306e\u56de\u7b54\u3068\u3057\u3066\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u3059\u3002 \u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u306f32\u30d3\u30c3\u30c8\u7248\u306eOffice 20 [&hellip;]","protected":false},"author":1,"featured_media":3347,"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],"tags":[],"class_list":["post-4386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eye-catchOutlook-VBA.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-18K","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4386","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=4386"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4386\/revisions"}],"predecessor-version":[{"id":4387,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4386\/revisions\/4387"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/3347"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}