View Single Post
 
Old 08-18-2014, 07:06 PM
gmaxey gmaxey is offline Windows 7 32bit 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