Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-09-2021, 10:49 PM
NicoleJones NicoleJones is offline Adding Custom Document Properties Windows 10 Adding Custom Document Properties Office 2016
Novice
Adding Custom Document Properties
 
Join Date: Jan 2020
Posts: 11
NicoleJones is on a distinguished road
Default Adding Custom Document Properties

Hi



I am trying to add new document properties a new document is created off of a template, however I get run-time error "Invalid procedure call or argument". Just wondering if anyone knows where I am going wrong

Code:
Dim APS_ContractNumber As Boolean
Dim APS_DocumentCode As Boolean
Dim APS_DocumentNumber As Boolean
Dim APS_DocumentTitle As Boolean
Dim APS_DocumentType As Boolean
Dim APS_Revision As Boolean
Dim APS_RevisionDate As Boolean
Dim APS_SubjectCode As Boolean
Dim APS_UniqueIdentifier As Boolean


Private Sub Document_New()
    With ActiveDocument.CustomDocumentProperties
        .Add Name:="APS_ContractNumber", _
            LinkToContent:=True, _
            Type:=msoPropertyTypeString, _
            Value:="[Contract Number]"
        .Add Name:="APS_DocumentCode", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeNumber, _
            Value:="[Document Code]"
        .Add Name:="APS_DocumentNumber", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[Document Number]"
        .Add Name:="APS_DocumentTitle", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[Document Title]"
        .Add Name:="APS_DocumentType", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[DDD]"
        .Add Name:="APS_Revision", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[RR]"
         .Add Name:="APS_RevisionDate", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeDate, _
            Value:="[01/01/2000]"
        .Add Name:="APS_SubjectCode", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[Subject Code]"
         .Add Name:="APS_UniqueIdentifier", _
            LinkToContent:=False, _
            Type:=msoPropertyTypeString, _
            Value:="[XXX]"
    End With

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Custom Document Properties Create Custom Document Properties with Content Control kschmidt Word VBA 7 02-04-2019 03:09 PM
Add custom doc properties in "Doc properties control" eazysnatch Word 2 09-13-2017 08:08 PM
Adding Custom Document Properties Updating Document Properties without using advanced properties dialogue thedr9wningman Word VBA 3 01-20-2014 05:56 PM
Custom Properties b-baker Word 1 03-01-2012 01:15 AM
Adding Custom Document Properties Add custom document properties into document NicBodkin Word 8 05-05-2011 09:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft