{"id":4421,"date":"2015-12-07T15:48:32","date_gmt":"2015-12-07T06:48:32","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4421"},"modified":"2015-12-07T15:48:32","modified_gmt":"2015-12-07T06:48:32","slug":"customdocumentproperties","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/customdocumentproperties\/","title":{"rendered":"\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\uff08CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<p>\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u306f\u3001\u30d6\u30c3\u30af\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u4efb\u610f\u306e\u9805\u76ee\u540d\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3082\u306e\u3092\u3044\u3044\u307e\u3059\u3002<strong>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u3059 <strong>DocumentProperties \u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/strong> \u3092\u53d6\u5f97\u3084\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CustomDocumentProperties<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/>\n<h2>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3 \u306e\u4e3b\u306a\u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<h3>CustomDocumentProperties.Add \u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><strong>Add \u30e1\u30bd\u30c3\u30c9<\/strong> \u3092\u4f7f\u7528\u3057\u3066\u4efb\u610f\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CustomDocumentProperties.Add<\/strong> ( <em>name<\/em>, <em>linktocontent<\/em>, <em>type<\/em>, <em>value<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>name&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>linktocontent&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u30b3\u30f3\u30c6\u30ca\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5185\u5bb9\u3092\u30ea\u30f3\u30af\u3055\u305b\u308b\u304b\u3092 <strong>\u30d6\u30fc\u30eb\u578b\uff08boolean\uff09<\/strong>\u306e\u5024\u3067\u3001\u8a2d\u5b9a\u3057\u307e\u3059\u3002<strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u3001\u5f15\u6570 <em>value<\/em> \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>type&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30c7\u30fc\u30bf\u306e\u7a2e\u985e\u3092\u8868\u3059 <strong>MsoDocProperties \u5217\u6319\u578b<\/strong> \u306e\u5b9a\u6570\u307e\u305f\u306f\u305d\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"200\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"50\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">msoPropertyTypeNumber<\/td>\n<td width=\"50\" align = \"center\">1<\/td>\n<td width=\"400\">\u6574\u6570\u578b (Integer) \u306e\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">msoPropertyTypeBoolean<\/td>\n<td width=\"50\" align = \"center\">2<\/td>\n<td width=\"400\">\u30d6\u30fc\u30eb\u578b (Boolean) \u306e\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">msoPropertyTypeDate<\/td>\n<td width=\"50\" align = \"center\">3<\/td>\n<td width=\"400\">\u65e5\u4ed8\u578b (Date) \u306e\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">msoPropertyTypeString<\/td>\n<td width=\"50\" align = \"center\">4<\/td>\n<td width=\"400\">\u6587\u5b57\u5217\u578b (String) \u306e\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">msoPropertyTypeFloat<\/td>\n<td width=\"50\" align = \"center\">5<\/td>\n<td width=\"400\">\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b (Floating point) \u306e\u5024<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>value&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u5f15\u6570 <em>LinkToContent<\/em> \u306b <strong>True<\/strong> \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u5f15\u6570 <em>value<\/em> \u306b\u6307\u5b9a\u3057\u305f\u5024\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002\uff09<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3 \u306e\u4e3b\u306a\u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<h3>CustomDocumentProperties.Item (<em>index<\/em>) \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p>\u5f15\u6570 <em>index<\/em> \u3092\u4f7f\u7528\u3057\u3066\u3001<strong>DocumentProperties \u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/strong> \u5185\u306e\u500b\u5225\u306e <strong>DocumentProperty\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CustomDocumentProperties<\/strong> [.<strong>Item<\/strong>] ( <em>index<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>index&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u53d6\u5f97\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u540d\u524d\uff08<em>name<\/em> \u306e\u5024\uff09\u307e\u305f\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>Item<\/strong> \u306f\u3001\u7701\u7565\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p class=\"caution4\"><strong>\u30e6\u30fc\u30b6\u30fc\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u524a\u9664\u3059\u308b\u4f8b<\/strong><br \/>\n      <strong>Delete \u30e1\u30bd\u30c3\u30c9<\/strong> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n      \u3000ActiveWorkbook.CustomDocumentProperties.Item(1).Delete\n    <\/p>\n<\/p><\/div>\n<br \/>\n<h3>CustomDocumentProperties.Count \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p>\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u3059 <strong>DocumentProperties \u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/strong> \u5185\u306e\u9805\u76ee\u6570\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CustomDocumentProperties.Count<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/><br \/>\n<h2>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_CustomDocumentProperties()\r\n\r\n    Dim i As Integer\r\n    Dim w As Workbook\r\n    Set w = Workbooks.Open(\"C:\\Documents\\mybook.xlsx\")\r\n\r\n    '\u8a2d\u5b9a\u6e08\u307f\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u524a\u9664\r\n    For i = 1 To w.CustomDocumentProperties.Count\r\n        \r\n        w.CustomDocumentProperties(i).Delete\r\n    \r\n    Next i\r\n    \r\n    '\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\r\n    w.CustomDocumentProperties.Add Name:=\"\u8a18\u9332\u8005\", _\r\n                                   LinkToContent:=False, _\r\n                                   Type:=4, _\r\n                                   Value:=\"\u5c71\u7530\u592a\u90ce\"\r\n    \r\n    '\u8a2d\u5b9a\u3057\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\r\n    MsgBox w.CustomDocumentProperties(1).Name & vbCrLf & _\r\n           w.CustomDocumentProperties(1).Value\r\n\r\n    w.Close\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/customdocumentproperties01.jpg?ssl=1\" rel=\"lightbox[4421]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/customdocumentproperties01.jpg?resize=168%2C170&#038;ssl=1\" alt=\"CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3\" width=\"168\" height=\"170\" class=\"alignnone size-full wp-image-4422\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/customdocumentproperties01.jpg?w=168&amp;ssl=1 168w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/customdocumentproperties01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>CustomDocumentProperties \u30d7\u30ed\u30d1\u30c6\u30a3 \u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u30c9\u30ad &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[357],"tags":[687,688,63,363,38,360],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/customdocumentproperties01.jpg?fit=168%2C170&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-19j","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4421"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=4421"}],"version-history":[{"count":6,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4421\/revisions"}],"predecessor-version":[{"id":4470,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4421\/revisions\/4470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4422"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}