{"id":2288,"date":"2012-09-20T13:37:24","date_gmt":"2012-09-20T04:37:24","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2288"},"modified":"2013-08-19T17:26:42","modified_gmt":"2013-08-19T08:26:42","slug":"%e3%82%b3%e3%83%b3%e3%83%86%e3%83%b3%e3%83%84%e3%82%b3%e3%83%b3%e3%83%88%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%96%e9%83%a8xml%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%83%9e%e3%83%83","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2288","title":{"rendered":"\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306b\u5916\u90e8XML\u306e\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d7\u3059\u308bWord\u30de\u30af\u30ed"},"content":{"rendered":"<p>Word 2007\u3067\u8ffd\u52a0\u3055\u308c\u305f\u6a5f\u80fd\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/span>\u300d\u3092\u4f7f\u3046\u3068\u5916\u90e8\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u30c7\u30fc\u30bf\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306b\u5916\u90e8\u306eXML\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u5143\u306b\u306a\u308bXML\u30d5\u30a1\u30a4\u30eb\u3068\u5bfe\u8c61\u3068\u306a\u308b\u6587\u66f8\u306e\u6e96\u5099\u3067\u3059\u3002<br \/>\n<strong><br \/>\n\u30fbC:\\Test\\Customer.xml<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot;?&gt;\r\n&lt;Customer&gt;\r\n  &lt;CompanyName&gt;\u682a\u5f0f\u4f1a\u793eka-net&lt;\/CompanyName&gt;\r\n  &lt;ContactName&gt;\u304d\u306c\u3042\u3055&lt;\/ContactName&gt;\r\n  &lt;ContactTitle&gt;\u7d4c\u7406\u90e8\u9577&lt;\/ContactTitle&gt;\r\n  &lt;Phone&gt;12-3456-7890&lt;\/Phone&gt;\r\n&lt;\/Customer&gt;<\/pre>\n<p><strong>\u30fbWord\u6587\u66f8\u306b\u4e0b\u56f3\u306e\u3088\u3046\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u633f\u5165\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01-300x197.jpg\" alt=\"\" title=\"XMLMapping_01\" width=\"300\" height=\"197\" class=\"alignnone size-medium wp-image-2289\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01-300x197.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01-290x191.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01-150x98.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_01.jpg 832w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6b21\u306b\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb(\u4eca\u56de\u306f\u30c6\u30ad\u30b9\u30c8 \u30b3\u30f3\u30c6\u30f3\u30c4 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb)\u3092\u6587\u66f8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\n\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u958b\u767a<\/span>\u300d\u30bf\u30d6\u304b\u3089\u624b\u52d5\u3067\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u30de\u30af\u30ed\u3067\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub AddContentControls()\r\n'\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u633f\u5165\r\n  With ActiveDocument.Tables(1)\r\n    .Cell(2, 2).Range.ContentControls.Add(wdContentControlText).SetPlaceholderText Text:=&quot;\u9867\u5ba2\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;\r\n    .Cell(3, 2).Range.ContentControls.Add(wdContentControlText).SetPlaceholderText Text:=&quot;\u62c5\u5f53\u8005\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;\r\n    .Cell(4, 2).Range.ContentControls.Add(wdContentControlText).SetPlaceholderText Text:=&quot;\u62c5\u5f53\u8005\u306e\u80a9\u66f8\u304d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;\r\n    .Cell(5, 2).Range.ContentControls.Add(wdContentControlText).SetPlaceholderText Text:=&quot;\u96fb\u8a71\u756a\u53f7\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u306b\u4e0b\u56f3\u306e\u3088\u3046\u306b\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u304c\u633f\u5165\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02-300x197.jpg\" alt=\"\" title=\"XMLMapping_02\" width=\"300\" height=\"197\" class=\"alignnone size-medium wp-image-2290\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02-300x197.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02-290x191.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02-150x98.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_02.jpg 832w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6700\u5f8c\u306bXML\u306e\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub SetXMLMap()\r\n'\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306bXML\u306e\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d4\u30f3\u30b0\r\n  If ActiveDocument.CustomXMLParts.Add.Load(&quot;C:\\Test\\Customer.xml&quot;) Then '\u30ab\u30b9\u30bf\u30e0XML\u30d1\u30fc\u30c4\u3092\u8ffd\u52a0\u3057\u3066\u5916\u90e8XML\u30d5\u30a1\u30a4\u30eb\u8aad\u8fbc\r\n    'XPath\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d4\u30f3\u30b0\r\n    ActiveDocument.ContentControls(1).XMLMapping.SetMapping &quot;\/Customer\/CompanyName&quot;\r\n    ActiveDocument.ContentControls(2).XMLMapping.SetMapping &quot;\/Customer\/ContactName&quot;\r\n    ActiveDocument.ContentControls(3).XMLMapping.SetMapping &quot;\/Customer\/ContactTitle&quot;\r\n    ActiveDocument.ContentControls(4).XMLMapping.SetMapping &quot;\/Customer\/Phone&quot;\r\n  End If\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f\u3001\u6587\u66f8\u5185\u306eCustomXMLParts\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u65b0\u3057\u3044CustomXMLPart\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u3001\u5404\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306bXML\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u3092XPath\u3067\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03-300x197.jpg\" alt=\"\" title=\"XMLMapping_03\" width=\"300\" height=\"197\" class=\"alignnone size-medium wp-image-2291\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03-300x197.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03-290x191.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03-150x98.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/XMLMapping_03.jpg 832w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4ee5\u4e0a\u306e\u3088\u3046\u306b\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u6d3b\u7528\u3059\u308b\u3068\u5916\u90e8\u306e\u30c7\u30fc\u30bf\u3068\u306e\u9023\u643a\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u306e\u3067\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306fWord\u6587\u66f8\u3060\u3051\u3069\u4e2d\u306e\u30c7\u30fc\u30bf\u306f\u5916\u90e8\u30c7\u30fc\u30bf\u304b\u3089\u6301\u3063\u3066\u304d\u305f\u3044\u3001\u3068\u3044\u3046\u5834\u5408\u306b\u306f\u5f79\u7acb\u3064\u51e6\u7406\u3060\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Word 2007\u3067\u8ffd\u52a0\u3055\u308c\u305f\u6a5f\u80fd\u300c\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u300d\u3092\u4f7f\u3046\u3068\u5916\u90e8\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u30c7\u30fc\u30bf\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002 \u4eca\u56de\u306f\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306b\u5916\u90e8\u306eXML\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002  [&hellip;]","protected":false},"author":1,"featured_media":7134,"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,49],"tags":[45,85],"class_list":["post-2288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-word-office","tag-word-","tag-word-vba-2"],"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-AU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2288","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=2288"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2288\/revisions"}],"predecessor-version":[{"id":2293,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2288\/revisions\/2293"}],"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=2288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}