Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2019, 04:49 PM
kschmidt kschmidt is offline Create Custom Document Properties with Content Control Windows 10 Create Custom Document Properties with Content Control Office 2016
Novice
Create Custom Document Properties with Content Control
 
Join Date: Feb 2019
Posts: 4
kschmidt is on a distinguished road
Default Create Custom Document Properties with Content Control

Hi,

I am looking to create custom document properties that can be referenced throughout a document with content controls and modified from a single location within the document. The file referenced in this link (CCtrl DocProp.zip) is exactly what I am aiming for, however I am unsure how to replicate this in the document I am using or create any additional.



I am fairly new to working outside of bare bones Microsoft Word so a good amount of this is difficult for my head to wrap around, but any help would be extremely appreciated!
Reply With Quote
  #2  
Old 02-01-2019, 08:17 PM
macropod's Avatar
macropod macropod is online now Create Custom Document Properties with Content Control Windows 7 64bit Create Custom Document Properties with Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,857
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Post #4 in that thread explains how the setup was created.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-01-2019, 08:29 PM
Guessed's Avatar
Guessed Guessed is offline Create Custom Document Properties with Content Control Windows 10 Create Custom Document Properties with Content Control Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,218
Guessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud ofGuessed has much to be proud of
Default

Have a look at the template developed by Greg Maxey and described here https://gregmaxey.com/word_tip_pages...rol_tools.html
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 02-04-2019, 12:50 PM
kschmidt kschmidt is offline Create Custom Document Properties with Content Control Windows 10 Create Custom Document Properties with Content Control Office 2016
Novice
Create Custom Document Properties with Content Control
 
Join Date: Feb 2019
Posts: 4
kschmidt is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Post #4 in that thread explains how the setup was created.
Thanks, I just realized what I was doing wrong before. Is there a way to modify the code to work with dates as well?
Reply With Quote
  #5  
Old 02-04-2019, 01:07 PM
macropod's Avatar
macropod macropod is online now Create Custom Document Properties with Content Control Windows 7 64bit Create Custom Document Properties with Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,857
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Custom Document Properties can contain text, numbers, dates, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 02-04-2019, 01:40 PM
kschmidt kschmidt is offline Create Custom Document Properties with Content Control Windows 10 Create Custom Document Properties with Content Control Office 2016
Novice
Create Custom Document Properties with Content Control
 
Join Date: Feb 2019
Posts: 4
kschmidt is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Custom Document Properties can contain text, numbers, dates, etc.
I attempted to include a Custom Document Property as a date and then reference it through both a Plain Text Content Control and Date Picker Content Control, however I get:

"Run-time error '13':

Type mismatch"

Code:
Case "BidO": .CustomDocumentProperties("BidO").Value = ContentControl.Range.Text
This is what my line currently looks like for the specified document property. I'm assuming it is currently written for only text content control?
Reply With Quote
  #7  
Old 02-04-2019, 01:55 PM
macropod's Avatar
macropod macropod is online now Create Custom Document Properties with Content Control Windows 7 64bit Create Custom Document Properties with Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,857
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You need to ensure the Custom Document Property type matches your content control's output. A date output as "Tuesday, 5 February" is text, whilst "5/2/2019" is a date. If using a date type, you'll also need code for handling your content control when it displays the placeholder text. For example:
Code:
With ContentControl
  If .ShowingPlaceholderText = True Then
    ActiveDocument.CustomDocumentProperties("BidO").Value = "1/1/1900"
  Else
    ActiveDocument.CustomDocumentProperties("BidO").Value = ContentControl.Range.Text
  End If
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 02-04-2019, 03:09 PM
kschmidt kschmidt is offline Create Custom Document Properties with Content Control Windows 10 Create Custom Document Properties with Content Control Office 2016
Novice
Create Custom Document Properties with Content Control
 
Join Date: Feb 2019
Posts: 4
kschmidt is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You need to ensure the Custom Document Property type matches your content control's output. A date output as "Tuesday, 5 February" is text, whilst "5/2/2019" is a date. If using a date type, you'll also need code for handling your content control when it displays the placeholder text.
Ah, I didn't know a date output of "Tuesday, February 5" was considered text instead of a date. Thank you for all of the help!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Custom Document Properties with Content Control Get value from Content control from SharePoint document EvaMads Word VBA 8 09-28-2018 02:40 AM
Add custom doc properties in "Doc properties control" eazysnatch Word 2 09-13-2017 08:08 PM
Create Custom Document Properties with Content Control export data from content control properties shadowplay Word 1 07-04-2016 11:36 PM
Create Custom Document Properties with Content Control Create content control for clip art not a picture from file... swissmiss Drawing and Graphics 3 11-01-2013 05:43 PM
Create Custom Document Properties with Content Control 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 01:27 PM.


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