So I am creating an order form that is comprized of Table/Cells in Word (365). I would like it to generate a random "8" digit number (Between 11111111-99999999) upon opening the document and insert said "Random Number" in a specific cell (which I have bookmarked as "BOL".
I have found some code that will generate a random number between the values I need but displays it in a message box. I would like the "Random Number" to not display in a message box and only fill in the specific cell/bookmark mentioned previously with the value that was generated. I've searched all over and cannot figure out what to edit the code to use the "value" generated for the "Random Number" and populate the cell/bookmark.
Document will ultimately be protected with editing restrictions limited to filling in forms. I have successfully run the code listed below but could use some help in figuring out the rest.
Sub Document_Open()
'Generate_Random_Number ()
maxNumber = 99999999
minNumber = 11111111
randomNumber = Int(maxNumber * Rnd) + minNumber
MsgBox randomNumber
End Sub