Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 08-18-2014, 07:06 PM
gmaxey gmaxey is offline Update Custom Document Property in Template Windows 7 32bit Update Custom Document Property in Template Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Is this really the name of the property:
"RandomNumbe r"

The following creates a new document based on the template and places a new random number in both the template and the new document just created.
Code:
 Sub AutoNew()
Dim lngNewRandNumber
Randomize
lngNewRandNumber = Int((1000 * Rnd) + 1)
'Updates the template property.
ThisDocument.CustomDocumentProperties("RandomNumber").Value = lngNewRandNumber
'Updates the document you have just created.
ActiveDocument.CustomDocumentProperties("RandomNumber").Value = lngNewRandNumber
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Custom Document Property in Template Can you make a document automatically update changes styles template? New Daddy Word 7 02-24-2017 03:52 PM
Update Custom Document Property in Template Insert image based on document custom property anandyrh Word 1 08-14-2013 12:08 AM
Custom Document Property Lost From Template bhaughey Word 8 03-05-2013 02:11 PM
Update Custom Document Property in Template QuickParts - custom document property untttt Word 2 06-09-2011 05:24 PM
Update Document Template when Saving the Document File bjbercaw Word 3 11-16-2010 02:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:03 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