{"action":"created","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/619","repository_url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/619/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/619/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/619/events","html_url":"https://github.com/MicrosoftDocs/VBA-Docs/issues/619","id":396036109,"node_id":"MDU6SXNzdWUzOTYwMzYxMDk=","number":619,"title":"I can't create an DocumentProperty variable to loop through the BuiltinDocumentProperties collection","user":{"login":"mhanders88","id":10783502,"node_id":"MDQ6VXNlcjEwNzgzNTAy","avatar_url":"https://avatars2.githubusercontent.com/u/10783502?v=4","gravatar_id":"","url":"https://api.github.com/users/mhanders88","html_url":"https://github.com/mhanders88","followers_url":"https://api.github.com/users/mhanders88/followers","following_url":"https://api.github.com/users/mhanders88/following{/other_user}","gists_url":"https://api.github.com/users/mhanders88/gists{/gist_id}","starred_url":"https://api.github.com/users/mhanders88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhanders88/subscriptions","organizations_url":"https://api.github.com/users/mhanders88/orgs","repos_url":"https://api.github.com/users/mhanders88/repos","events_url":"https://api.github.com/users/mhanders88/events{/privacy}","received_events_url":"https://api.github.com/users/mhanders88/received_events","type":"User","site_admin":false},"labels":[{"id":1041947735,"node_id":"MDU6TGFiZWwxMDQxOTQ3NzM1","url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/labels/stack%20overflow","name":"stack overflow","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":{"login":"Linda-Editor","id":27295799,"node_id":"MDQ6VXNlcjI3Mjk1Nzk5","avatar_url":"https://avatars1.githubusercontent.com/u/27295799?v=4","gravatar_id":"","url":"https://api.github.com/users/Linda-Editor","html_url":"https://github.com/Linda-Editor","followers_url":"https://api.github.com/users/Linda-Editor/followers","following_url":"https://api.github.com/users/Linda-Editor/following{/other_user}","gists_url":"https://api.github.com/users/Linda-Editor/gists{/gist_id}","starred_url":"https://api.github.com/users/Linda-Editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linda-Editor/subscriptions","organizations_url":"https://api.github.com/users/Linda-Editor/orgs","repos_url":"https://api.github.com/users/Linda-Editor/repos","events_url":"https://api.github.com/users/Linda-Editor/events{/privacy}","received_events_url":"https://api.github.com/users/Linda-Editor/received_events","type":"User","site_admin":false},"assignees":[{"login":"Linda-Editor","id":27295799,"node_id":"MDQ6VXNlcjI3Mjk1Nzk5","avatar_url":"https://avatars1.githubusercontent.com/u/27295799?v=4","gravatar_id":"","url":"https://api.github.com/users/Linda-Editor","html_url":"https://github.com/Linda-Editor","followers_url":"https://api.github.com/users/Linda-Editor/followers","following_url":"https://api.github.com/users/Linda-Editor/following{/other_user}","gists_url":"https://api.github.com/users/Linda-Editor/gists{/gist_id}","starred_url":"https://api.github.com/users/Linda-Editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linda-Editor/subscriptions","organizations_url":"https://api.github.com/users/Linda-Editor/orgs","repos_url":"https://api.github.com/users/Linda-Editor/repos","events_url":"https://api.github.com/users/Linda-Editor/events{/privacy}","received_events_url":"https://api.github.com/users/Linda-Editor/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2019-01-04T19:15:16Z","updated_at":"2019-01-04T22:42:33Z","closed_at":"2019-01-04T22:30:47Z","author_association":"NONE","body":"I've created a VBA function to refer to an instance of a Word Document in an Excel vba code, but it won't let me set an \"DocumentProperty\" object I declared to the first item in the BuiltinDocumentProperties collection. \n\nIt works in Word vba in the document itself, but it won't work when using Excel VBA as a ByRef Function.\n\nSub test()\nDim wdApp As Word.Application\nDim wdDocPro As DocumentProperty\n\nSet wdApp = GetObject(, \"Word.Application\")\nSet wdDoc = wdApp.ActiveDocument\nSet wdDocPro = wdDoc.BuiltInDocumentProperties.Item(1) ' I get a type mismatch on this line in the excel VBA\nMsgBox (wdDocPro.Value)\nEnd Sub\n\n---\n#### Document Details\n\n⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*\n\n* ID: a4eab602-cf28-182b-23bb-c2c95b5a3bb8\n* Version Independent ID: 0821a7b7-94ac-467b-3bdb-afac94cef3da\n* Content: [Document.BuiltInDocumentProperties property (Word)](https://docs.microsoft.com/en-us/office/vba/api/word.document.builtindocumentproperties)\n* Content Source: [api/Word.Document.BuiltInDocumentProperties.md](https://github.com/MicrosoftDocs/VBA-Docs/blob/master/api/Word.Document.BuiltInDocumentProperties.md)\n* Product: **word**\n* GitHub Login: @o365devx\n* Microsoft Alias: **o365devx**"},"comment":{"url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/comments/451590676","html_url":"https://github.com/MicrosoftDocs/VBA-Docs/issues/619#issuecomment-451590676","issue_url":"https://api.github.com/repos/MicrosoftDocs/VBA-Docs/issues/619","id":451590676,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTU5MDY3Ng==","user":{"login":"retailcoder","id":5751684,"node_id":"MDQ6VXNlcjU3NTE2ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5751684?v=4","gravatar_id":"","url":"https://api.github.com/users/retailcoder","html_url":"https://github.com/retailcoder","followers_url":"https://api.github.com/users/retailcoder/followers","following_url":"https://api.github.com/users/retailcoder/following{/other_user}","gists_url":"https://api.github.com/users/retailcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/retailcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retailcoder/subscriptions","organizations_url":"https://api.github.com/users/retailcoder/orgs","repos_url":"https://api.github.com/users/retailcoder/repos","events_url":"https://api.github.com/users/retailcoder/events{/privacy}","received_events_url":"https://api.github.com/users/retailcoder/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T22:42:33Z","updated_at":"2019-01-04T22:42:33Z","author_association":"CONTRIBUTOR","body":"It seems you can't assign to an early-bound `Office.DocumentProperties` or `Office.DocumentProperty` object variable from an out-of-process Word application instance. I get the same consistent behavior in Word when accessing an Excel workbook's `BuildInDocumentProperties` - a type mismatch error is thrown if I try to assign that reference to an `Office.DocumentProperties`, but works fine if I declare everything as `Variant` (the variant subtype at run-time is `Variant/Object/DocumentProperties`, but a `TypeOf props Is Office.DocumentProperties` type check fails (but passes when the Office types are accessed in-process, e.g. when accessing Excel document properties from inside an Excel document, or when accessing Word document properties from inside a Word document)."}}
{"actor":{"display_login":"retailcoder"}}