{"id":6375,"date":"2015-10-22T13:06:28","date_gmt":"2015-10-22T04:06:28","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=6375"},"modified":"2016-10-28T23:01:35","modified_gmt":"2016-10-28T14:01:35","slug":"word-vba%e3%83%ab%e3%83%93%e3%81%b5%e3%82%8a%e3%81%8c%e3%81%aa%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%81%ae%e6%93%8d%e4%bd%9c%e3%81%ab%e6%8c%91%e3%82%80","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=6375","title":{"rendered":"[Word VBA]\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u64cd\u4f5c\u306b\u6311\u3080"},"content":{"rendered":"<p><span style=\"color: #ff0000; font-weight: bold;\">2016\/10\/28 \u8ffd\u8a18\uff1a<\/span><br \/>\n\u6539\u826f\u7248\u306e\u30de\u30af\u30ed\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<div class=\"cardlink\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=7576\"><div class=\"cardlink_thumbnail\"><img src='https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-WordVBA-120x120.png' alt='\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed(\u6539\u826f\u7248)' width=120 height=120 \/><\/a><\/div><div class=\"cardlink_content\"><span class=\"timestamp\">2016.10.28<\/span><div class=\"cardlink_title\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=7576\">\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed(\u6539\u826f\u7248) <\/a><\/div><div class=\"cardlink_excerpt\">\u3053\u308c\u307e\u3067\u5f53\u30d6\u30ed\u30b0\u3067\u306f\u30eb\u30d3\u3092\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed\u306b\u3064\u3044\u3066\u3001\u3044\u304f\u3064\u304b\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u304d\u307e\u3057\u305f\u3002\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\u305d\u308c\u3089\u306fExcel\u3092\u5229\u7528\u3059\u308b\u3082\u306e\u3067\u3042\u3063\u305f\u308a\u3001\u30eb\u30d3\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u7121\u7406\u3084\u308a\u64cd\u4f5c\u3059\u308b\u3082\u306e\u3067\u3042\u3063\u305f\u308a\u3057\u3066\u3001\u3042\u307e\u308a\u5b9f\u7528\u7684\u3067\u306f\u306a\u3044\u30ec\u30d9\u30eb\u306e\u30de\u30af\u30ed\u3067\u3057\u305f\u3002\r...<\/div><\/div><div class=\"cardlink_footer\"><\/div><\/div>\n<hr \/>\n<p>\u300c<span style=\"color: #ff0000; font-weight: bold;\">Word\u3067\u30eb\u30d3\u632f\u308a\u3092\u4e00\u62ec\u3067\u884c\u3044\u305f\u3044<\/span>\u300d\u3001\u3053\u3046\u3044\u3063\u305f\u8981\u671b\u306f\u6614\u304b\u3089\u3088\u304f\u3042\u308a\u3001\u3053\u308c\u307e\u3067\u69d8\u3005\u306a\u624b\u6cd5\u304c\u7d39\u4ecb\u3055\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>Word2003\u3067\u4f5c\u6210\u3057\u305f\u6587\u66f8\u306b\u4e00\u62ec\u3067\u30eb\u30d3\u3092\u3075\u308b\u65b9\u6cd5<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/groups.google.com\/forum\/#!topic\/microsoft.public.jp.word\/ZNstY3ap7V8\" target=\"_blank\" title=\"Word2003\u3067\u4f5c\u6210\u3057\u305f\u6587\u66f8\u306b\u4e00\u62ec\u3067\u30eb\u30d3\u3092\u3075\u308b\u65b9\u6cd5\">https:\/\/groups.google.com\/forum\/#!topic\/microsoft.public.jp.word\/ZNstY3ap7V8<\/a><\/li>\n<li>\u30eb\u30d3\u3092\u30ab\u30bf\u30ab\u30ca\u3067\u3064\u3051\u308b\u65b9\u6cd5 <\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/microsoft.public.jp.word.narkive.com\/FJ2m9feU\" target=\"_blank\" title=\"\u30eb\u30d3\u3092\u30ab\u30bf\u30ab\u30ca\u3067\u3064\u3051\u308b\u65b9\u6cd5 \">http:\/\/microsoft.public.jp.word.narkive.com\/FJ2m9feU<\/a><\/li>\n<li>\u5168\u6587\u30eb\u30d3\u632f\u308a(07\/11\/25)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/homepage2.nifty.com\/miyahn\/\" target=\"_blank\" title=\"\u5168\u6587\u30eb\u30d3\u632f\u308a(07\/11\/25)\">http:\/\/homepage2.nifty.com\/miyahn\/<\/a><\/li>\n<li>\u9ad8\u901f\u30eb\u30d3\uff08Word VBA\u306b\u3088\u308b\u30de\u30af\u30ed\uff09<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/sites.google.com\/site\/osamumimura\/home\/ruby\" target=\"_blank\" title=\"\u9ad8\u901f\u30eb\u30d3\uff08Word VBA\u306b\u3088\u308b\u30de\u30af\u30ed\uff09\">https:\/\/sites.google.com\/site\/osamumimura\/home\/ruby<\/a><\/li>\n<li>\u30eb\u30d3\u4e00\u62ec\u5909\u63db\u3000\uff08Word VBA)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/www2s.biglobe.ne.jp\/~Taiju\/leaf\/tjsoft81_Ruby_Auto.htm\" target=\"_blank\" title=\"\u30eb\u30d3\u4e00\u62ec\u5909\u63db\u3000\uff08Word VBA)\">http:\/\/www2s.biglobe.ne.jp\/~Taiju\/leaf\/tjsoft81_Ruby_Auto.htm<\/a><\/li>\n<li>\u30eb\u30d3\u3075\u308a\u541bfor Word\uff082000-2003\u5bfe\u5fdc\uff09<\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/www.turtle-west.co.jp\/Soft6.htm\" target=\"_blank\" title=\"\u30eb\u30d3\u3075\u308a\u541bfor Word\uff082000-2003\u5bfe\u5fdc\uff09\">http:\/\/www.turtle-west.co.jp\/Soft6.htm<\/a><\/li>\n<li>\u632f\u306e\u7389 for Word<\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/www.vector.co.jp\/soft\/win95\/writing\/se161760.html\" target=\"_blank\" title=\"\u632f\u306e\u7389 for Word\">http:\/\/www.vector.co.jp\/soft\/win95\/writing\/se161760.html<\/a><\/li>\n<li>\u81ea\u52d5\u30eb\u30d3\u632f\u308a for Word<\/li>\n<li style=\"list-style-type:none;\"><a href=\"http:\/\/www.vector.co.jp\/soft\/winnt\/writing\/se504700.html\" target=\"_blank\" title=\"\u81ea\u52d5\u30eb\u30d3\u632f\u308a for Word\">http:\/\/www.vector.co.jp\/soft\/winnt\/writing\/se504700.html<\/a><\/li>\n<\/ul>\n<p>\u5f53\u30d6\u30ed\u30b0\u3067\u3082\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=4562\" title=\"\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed<\/a>\u300d\u3067Excel\u306eGetPhonetic\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u305f\u30de\u30af\u30ed\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u554f\u984c\u306a\u306e\u304c<span style=\"color: #ff0000; font-weight: bold;\">\u6027\u80fd\u306e\u4f4e\u3055\u3002<\/span><\/p>\n<p>\u5358\u8a9e\u5358\u4f4d\u3067\u306f\u307e\u3060\u3057\u3082\u6f22\u5b57\u4e00\u6587\u5b57\u3060\u3051\u306e\u51e6\u7406\u3068\u306a\u308b\u3068\u3001\u524d\u5f8c\u306e\u6587\u8108\u304c\u7121\u3044\u305f\u3081\u304b\u3001\u305f\u3068\u3048\u3070\u300c<strong>\u5408\u308f\u305b\u3066<\/strong>\u300d\u306e\u90e8\u5206\u304c\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u5408(\u3054\u3046)\u308f\u305b\u3066<\/span>\u300d\u306e\u3088\u3046\u306b\u3001\u307e\u3068\u3082\u306b\u3075\u308a\u304c\u306a\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u70b9Word\u65e2\u5b58\u306e\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u30eb\u30d3<\/span>\u300d\u6a5f\u80fd\u3067\u3042\u308c\u3070\u3001\u4e0b\u56f3\u306e\u3088\u3046\u306b\u3061\u3083\u3093\u3068\u3057\u305f\u3075\u308a\u304c\u306a\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_01.jpg\" alt=\"PhoneticDialog_Automation_01_01\" width=\"670\" height=\"427\" class=\"alignnone size-full wp-image-6376\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_01.jpg 670w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_01-300x191.jpg 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/p>\n<p>\u3067\u3042\u308c\u3070\u3001\u3053\u306e\u30eb\u30d3\u6a5f\u80fd\u3092\u5229\u7528\u3057\u305f\u30de\u30af\u30ed\u3092\u4f5c\u308c\u3070\u826f\u3044\u306e\u3067\u3059\u304c\u3001<a href=\"\/\/www.ka-net.org\/blog\/?p=4562\" title=\"\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\u3053\u306e\u8a18\u4e8b<\/a>\u3067\u3082\u66f8\u3044\u305f\u901a\u308a\u3001\u30eb\u30d3\u30c0\u30a4\u30a2\u30ed\u30b0(<span style=\"color: #ff0000; font-weight: bold;\">wdDialogPhoneticGuide<\/span>)\u306b\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u306a\u3044\u305f\u3081\u3001\u300c<a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/library\/ff836154.aspx\" title=\"Word \u306e\u7d44\u307f\u8fbc\u307f\u306e\u30c0\u30a4\u30a2\u30ed\u30b0 \u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b\" target=\"_blank\">Word \u306e\u7d44\u307f\u8fbc\u307f\u306e\u30c0\u30a4\u30a2\u30ed\u30b0 \u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b<\/a>\u300d\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u65b9\u6cd5\u3067\u3075\u308a\u304c\u306a\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3057\u3066\u30c0\u30a4\u30a2\u30ed\u30b0\u304b\u3089\u76f4\u63a5\u53d6\u5f97\u3057\u3088\u3046\u306b\u3082\u3001\u3053\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u201c<a href=\"http:\/\/e-words.jp\/w\/%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%83%80%E3%82%A4%E3%82%A2%E3%83%AD%E3%82%B0.html\" title=\"\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3068\u306f\uff5cmodal dialog\uff5c\u30e2\u30fc\u30c0\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6 - \u610f\u5473\/\u89e3\u8aac\/\u8aac\u660e\/\u5b9a\u7fa9 \uff1a IT\u7528\u8a9e\u8f9e\u5178\" target=\"_blank\">\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0<\/a>\u201d\u3067\u3042\u308b\u305f\u3081\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u958b\u304b\u308c\u305f\u77ac\u9593\u306b\u30de\u30af\u30ed\u306f\u505c\u6b62\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/library\/gg278655.aspx\" title=\"SendKeys \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\" target=\"_blank\">SendKeys<\/a>\u3092\u4f7f\u3063\u3066\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u30ad\u30fc\u30b9\u30c8\u30ed\u30fc\u30af\u3092\u9001\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u5b89\u5b9a\u6027\u306e\u9762\u3092\u8003\u3048\u308b\u3068\u3042\u307e\u308a\u4f7f\u3044\u305f\u304f\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u4e00\u4f53\u3069\u3046\u3059\u308b\u304b\uff1f\u7b54\u3048\u306f\u7c21\u5358\u3002<\/p>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u201cUI Automation\u3067\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u64cd\u4f5c\u3059\u308b\u30de\u30af\u30ed\u3092\u975e\u540c\u671f\u3067\u5b9f\u884c\u3059\u308b\u201d<\/span><\/p>\n<p>\u3053\u3068\u3067\u3059\u3002<br \/>\n(\u3082\u3061\u308d\u3093\u4ed6\u306e\u65b9\u6cd5\u3082\u3042\u308b\u3060\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3044\u308d\u3044\u308d\u8003\u3048\u308b\u306e\u3082\u9762\u5012\u306a\u306e\u3067\u76f4\u7403\u52dd\u8ca0\u3067\u3044\u304d\u307e\u3059\u3002)<\/p>\n<h4 class=\"style4a\">\u300c\u30eb\u30d3\u300d\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u64cd\u4f5c\u3059\u308bWord\u30de\u30af\u30ed<\/h4>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b [ThisDocument]\u306b\u8a18\u8ff0<\/span><br \/>\n<span style=\"color: #ff0000; font-weight: bold;\">\u203b UIAutomationClient(UIAutomationCore.dll)\u8981\u53c2\u7167<\/span><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">'ThisDocument\r\nOption Explicit\r\n\r\nPrivate d As Object\r\n\r\nPublic Sub Sample()\r\n  If Selection.Start &lt;&gt; Selection.End Then\r\n    Set d = CreateObject(&quot;htmlfile&quot;)\r\n    Set d.parentWindow.onhelp = Me\r\n    d.parentWindow.SetTimeout &quot;onhelp.ExecSetPhoneticDialog()&quot;, 100, &quot;VBScript&quot; 'setTimeout\u3067\u6642\u9593\u5dee\u5b9f\u884c\r\n    Application.Dialogs(wdDialogPhoneticGuide).Show\r\n  End If\r\nEnd Sub\r\n\r\nPublic Sub ExecSetPhoneticDialog(Optional ByVal dummy As Long = 0)\r\n'\u6587\u5b57\u5358\u4f4d,\u53f3\u63c3\u3048,\u30aa\u30d5\u30bb\u30c3\u30c8:20,\u30d5\u30a9\u30f3\u30c8:\u30e1\u30a4\u30ea\u30aa,\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba:15\r\n  SetPhoneticDialog False, False, &quot;\u53f3\u63c3\u3048&quot;, 20, &quot;\u30e1\u30a4\u30ea\u30aa&quot;, 15\r\nEnd Sub\r\n\r\nPrivate Sub SetPhoneticDialog(Optional ByVal flgClearReadingsButton As Boolean = False, _\r\n                              Optional ByVal flgGroup As Boolean = True, _\r\n                              Optional ByVal alignmentValue As String = &quot;&quot;, _\r\n                              Optional ByVal offsetValue As Long = 0, _\r\n                              Optional ByVal fontValue As String = &quot;&quot;, _\r\n                              Optional ByVal sizeValue As Long = 0)\r\n'&#x5B;\u30eb\u30d3]\u30c0\u30a4\u30a2\u30ed\u30b0\u64cd\u4f5c\r\n'\u203bUIAutomationClient(UIAutomationCore.dll)\u8981\u53c2\u7167\r\n'  \u5f15\u6570\u8aac\u660e\r\n'    flgClearReadingsButton : True : \u30eb\u30d3\u306e\u89e3\u9664\r\n'    flgGroup : True : \u6587\u5b57\u5217\u5168\u4f53, False : \u6587\u5b57\u5358\u4f4d\r\n'    alignmentValue : \u914d\u7f6e\r\n'    offsetValue : \u30aa\u30d5\u30bb\u30c3\u30c8\r\n'    fontValue : \u30d5\u30a9\u30f3\u30c8\r\n'    sizeValue : \u30b5\u30a4\u30ba\r\n  \r\n  Dim uiAuto As CUIAutomation\r\n  Dim elmRoot As IUIAutomationElement\r\n  Dim elmPhoneticDialog As IUIAutomationElement '\u30eb\u30d3\u30c0\u30a4\u30a2\u30ed\u30b0\r\n  Dim elmGroupButton As IUIAutomationElement '\u6587\u5b57\u5217\u5168\u4f53\r\n  Dim elmMonoButton As IUIAutomationElement '\u6587\u5b57\u5358\u4f4d\r\n  Dim elmClearReadingsButton As IUIAutomationElement '\u30eb\u30d3\u306e\u89e3\u9664\r\n  Dim elmOkButton As IUIAutomationElement 'OK\r\n  Dim elmAlignmentComboBox  As IUIAutomationElement '\u914d\u7f6e\r\n  Dim elmRubyEdit As IUIAutomationElement '\u30eb\u30d3\r\n  Dim elmOffsetEdit As IUIAutomationElement '\u30aa\u30d5\u30bb\u30c3\u30c8\r\n  Dim elmFontEdit As IUIAutomationElement '\u30d5\u30a9\u30f3\u30c8\r\n  Dim elmSizeEdit As IUIAutomationElement '\u30b5\u30a4\u30ba\r\n  Dim accAlignmentComboBox As IAccessible\r\n  Dim aptn As IUIAutomationLegacyIAccessiblePattern\r\n  Dim vptn As IUIAutomationValuePattern\r\n  Dim iptn As IUIAutomationInvokePattern\r\n  Dim i As Long\r\n  \r\n  Set uiAuto = New CUIAutomation\r\n  Set elmRoot = uiAuto.GetRootElement\r\n  \r\n  '&#x5B;\u30eb\u30d3]\u30c0\u30a4\u30a2\u30ed\u30b0\u53d6\u5f97\r\n  While elmPhoneticDialog Is Nothing\r\n    Set elmPhoneticDialog = GetElement(uiAuto, elmRoot, UIA_NamePropertyId, &quot;\u30eb\u30d3&quot;, UIA_WindowControlTypeId)\r\n    DoEvents\r\n  Wend\r\n  '&#x5B;\u6587\u5b57\u5217\u5168\u4f53]\u30dc\u30bf\u30f3\u53d6\u5f97\r\n  Set elmGroupButton = GetElement(uiAuto, elmPhoneticDialog, UIA_NamePropertyId, &quot;\u6587\u5b57\u5217\u5168\u4f53(G)&quot;, UIA_ButtonControlTypeId)\r\n  '&#x5B;\u6587\u5b57\u5358\u4f4d]\u30dc\u30bf\u30f3\u53d6\u5f97\r\n  Set elmMonoButton = GetElement(uiAuto, elmPhoneticDialog, UIA_NamePropertyId, &quot;\u6587\u5b57\u5358\u4f4d(M)&quot;, UIA_ButtonControlTypeId)\r\n  '&#x5B;\u30eb\u30d3\u306e\u89e3\u9664]\u30dc\u30bf\u30f3\u53d6\u5f97\r\n  Set elmClearReadingsButton = GetElement(uiAuto, elmPhoneticDialog, UIA_NamePropertyId, &quot;\u30eb\u30d3\u306e\u89e3\u9664(C)&quot;, UIA_ButtonControlTypeId)\r\n  '&#x5B;OK]\u30dc\u30bf\u30f3\u53d6\u5f97\r\n  Set elmOkButton = GetElement(uiAuto, elmPhoneticDialog, UIA_NamePropertyId, &quot;OK&quot;, UIA_ButtonControlTypeId)\r\n  '&#x5B;\u914d\u7f6e]\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u53d6\u5f97\r\n  Set elmAlignmentComboBox = GetElement(uiAuto, elmPhoneticDialog, UIA_NamePropertyId, &quot;\u914d\u7f6e(L):&quot;, UIA_ComboBoxControlTypeId)\r\n  '&#x5B;\u30eb\u30d3]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u53d6\u5f97\r\n  Set elmRubyEdit = GetElement(uiAuto, elmPhoneticDialog, UIA_AutomationIdPropertyId, &quot;19&quot;)\r\n  '&#x5B;\u30aa\u30d5\u30bb\u30c3\u30c8]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u53d6\u5f97\r\n  Set elmOffsetEdit = GetElement(uiAuto, elmPhoneticDialog, UIA_AutomationIdPropertyId, &quot;35&quot;)\r\n  '&#x5B;\u30d5\u30a9\u30f3\u30c8]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u53d6\u5f97\r\n  Set elmFontEdit = GetElement(uiAuto, elmPhoneticDialog, UIA_AutomationIdPropertyId, &quot;1792&quot;)\r\n  '&#x5B;\u30b5\u30a4\u30ba]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u53d6\u5f97\r\n  Set elmSizeEdit = GetElement(uiAuto, elmPhoneticDialog, UIA_AutomationIdPropertyId, &quot;1796&quot;)\r\n  \r\n  '&#x5B;\u30eb\u30d3\u306e\u89e3\u9664]\u30dc\u30bf\u30f3\u30af\u30ea\u30c3\u30af\r\n  If flgClearReadingsButton = True Then\r\n    Set iptn = elmClearReadingsButton.GetCurrentPattern(UIA_InvokePatternId)\r\n    iptn.Invoke\r\n  End If\r\n  '&#x5B;\u6587\u5b57\u5358\u4f4d]\u8a2d\u5b9a\r\n  If flgGroup = False Then\r\n    Set iptn = elmMonoButton.GetCurrentPattern(UIA_InvokePatternId)\r\n    iptn.Invoke\r\n  End If\r\n  \r\n  '&#x5B;\u914d\u7f6e]\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u8a2d\u5b9a\r\n  If alignmentValue &lt;&gt; &quot;&quot; Then\r\n    Select Case alignmentValue\r\n      Case &quot;\u4e2d\u592e\u63c3\u3048&quot;, &quot;\u5747\u7b49\u5272\u308a\u4ed8\u3051 1&quot;, &quot;\u5747\u7b49\u5272\u308a\u4ed8\u3051 2&quot;, &quot;\u5de6\u63c3\u3048&quot;, &quot;\u53f3\u63c3\u3048&quot;\r\n        Set aptn = elmAlignmentComboBox.GetCurrentPattern(UIA_LegacyIAccessiblePatternId)\r\n        Set accAlignmentComboBox = aptn.GetIAccessible\r\n        For i = 1 To accAlignmentComboBox.accChildCount\r\n          If accAlignmentComboBox.accName(i) = alignmentValue Then\r\n            accAlignmentComboBox.accDoDefaultAction i\r\n            Exit For\r\n          End If\r\n        Next\r\n    End Select\r\n  End If\r\n  \r\n  '&#x5B;\u30aa\u30d5\u30bb\u30c3\u30c8]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u8a2d\u5b9a\r\n  If offsetValue &lt;&gt; 0 Then\r\n    Set vptn = elmOffsetEdit.GetCurrentPattern(UIA_ValuePatternId)\r\n    vptn.SetValue CStr(offsetValue)\r\n  End If\r\n  '&#x5B;\u30d5\u30a9\u30f3\u30c8]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u8a2d\u5b9a\r\n  If fontValue &lt;&gt; &quot;&quot; Then\r\n    Set vptn = elmFontEdit.GetCurrentPattern(UIA_ValuePatternId)\r\n    vptn.SetValue fontValue\r\n  End If\r\n  '&#x5B;\u30b5\u30a4\u30ba]\u30a8\u30c7\u30a3\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u8a2d\u5b9a\r\n  If sizeValue &lt;&gt; 0 Then\r\n    Set vptn = elmSizeEdit.GetCurrentPattern(UIA_ValuePatternId)\r\n    vptn.SetValue CStr(sizeValue)\r\n  End If\r\n  \r\n  If Len(Trim(elmRubyEdit.GetCurrentPropertyValue(UIA_ValueValuePropertyId))) &lt; 1 Then\r\n    elmRubyEdit.SetFocus\r\n  Else\r\n    '&#x5B;OK]\u30dc\u30bf\u30f3\u30af\u30ea\u30c3\u30af\r\n    Set iptn = elmOkButton.GetCurrentPattern(UIA_InvokePatternId)\r\n    iptn.Invoke\r\n  End If\r\nEnd Sub\r\n\r\nPrivate Function GetElement(ByVal uiAuto As CUIAutomation, _\r\n                            ByVal elmParent As IUIAutomationElement, _\r\n                            ByVal propertyId As Long, _\r\n                            ByVal propertyValue As Variant, _\r\n                            Optional ByVal ctrlType As Long = 0)\r\n  Dim cndFirst As IUIAutomationCondition\r\n  Dim cndSecond As IUIAutomationCondition\r\n  \r\n  Set cndFirst = uiAuto.CreatePropertyCondition(propertyId, propertyValue)\r\n  If ctrlType &lt;&gt; 0 Then\r\n    Set cndSecond = uiAuto.CreatePropertyCondition(UIA_ControlTypePropertyId, ctrlType)\r\n    Set cndFirst = uiAuto.CreateAndCondition(cndFirst, cndSecond)\r\n  End If\r\n  Set GetElement = elmParent.FindFirst(TreeScope_Subtree, cndFirst)\r\nEnd Function<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_02.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_02.gif\" alt=\"PhoneticDialog_Automation_01_02\" width=\"533\" height=\"379\" class=\"alignnone size-full wp-image-6377\" \/><\/a><\/p>\n<p>\u4e0a\u56f3\u306e\u901a\u308a\u3001\u30de\u30af\u30ed\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4e00\u77ac\u3060\u3051\u30eb\u30d3\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u9805\u76ee\u901a\u308a\u306b\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3001OK\u30dc\u30bf\u30f3\u3067\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002<br \/>\n\u3042\u3068\u306f\u3053\u306e\u30de\u30af\u30ed\u3092\u9023\u7d9a\u3067\u5b9f\u884c\u3059\u308c\u3070\u3001\u3075\u308a\u304c\u306a\u306e\u4e00\u62ec\u8a2d\u5b9a\u304c\u884c\u3048\u308b\u306f\u305a\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u4e00\u3064\u554f\u984c\u304c\u2026\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_03.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PhoneticDialog_Automation_01_03.gif\" alt=\"PhoneticDialog_Automation_01_03\" width=\"608\" height=\"410\" class=\"alignnone size-full wp-image-6378\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000; font-weight: bold;\">Word 2016\u3060\u3068UI Automation\u306b\u3088\u308b\u64cd\u4f5c\u306f\u3067\u304d\u3066\u3044\u308b\u306f\u305a\u306a\u306e\u306b\u30d5\u30a9\u30f3\u30c8\u7b49\u306e\u8a2d\u5b9a\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u308b<\/span>\u306e\u3067\u3059\u3002<\/p>\n<p>\u307e\u3055\u304b\u306e\u843d\u3068\u3057\u7a74\u30fb\u30fb\u30fb\u3002<br \/>\n\u3055\u3059\u304c<span style=\"color: #ff0000; font-weight: bold;\">\u201c\u30eb\u30d3\u201d<\/span>\u30c0\u30a4\u30a2\u30ed\u30b0\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u4eca\u56de\u306f\u3053\u3053\u307e\u3067\u3002<br \/>\n\u5f15\u304d\u7d9a\u304d\u3001\u3053\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u64cd\u4f5c\u306b\u6311\u3093\u3067\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000; font-weight: bold;\">2015\/10\/22 \u7d9a\u7de8\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/span><\/p>\n<ul>\n<li>[Word VBA]\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u64cd\u4f5c\u306b\u6311\u3080(2)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"\/\/www.ka-net.org\/blog\/?p=6380\" target=\"_blank\" title=\"[Word VBA]\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u64cd\u4f5c\u306b\u6311\u3080(2)\">\/\/www.ka-net.org\/blog\/?p=6380<\/a><\/li>\n<\/ul>\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":"2016\/10\/28 \u8ffd\u8a18\uff1a \u6539\u826f\u7248\u306e\u30de\u30af\u30ed\u3092\u66f8\u304d\u307e\u3057\u305f\u3002 \u300cWord\u3067\u30eb\u30d3\u632f\u308a\u3092\u4e00\u62ec\u3067\u884c\u3044\u305f\u3044\u300d\u3001\u3053\u3046\u3044\u3063\u305f\u8981\u671b\u306f\u6614\u304b\u3089\u3088\u304f\u3042\u308a\u3001\u3053\u308c\u307e\u3067\u69d8\u3005\u306a\u624b\u6cd5\u304c\u7d39\u4ecb\u3055\u308c\u3066\u304d\u307e\u3057\u305f\u3002 Word2003\u3067\u4f5c\u6210\u3057\u305f\u6587\u66f8\u306b\u4e00\u62ec\u3067\u30eb\u30d3\u3092\u3075 [&hellip;]","protected":false},"author":1,"featured_media":7134,"comment_status":"open","ping_status":"closed","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,49],"tags":[],"class_list":["post-6375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-word-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Word.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1EP","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6375","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=6375"}],"version-history":[{"count":4,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6375\/revisions"}],"predecessor-version":[{"id":7583,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6375\/revisions\/7583"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7134"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}