Coding issue

Copper Contributor

I am trying to create a self grading document with coding. This is my first time coding. I am getting an error on the beginning line where I have typed:

 

Sub Document_Open () 

 

I followed a youtube video for instruction on this and did it identically to the video creator. I am getting the error message: Compile error: External name not defined

 

Please help!

4 Replies

@kymichelle95 Document_Open would be placed in the ThisDocument module of a document to run whenever the document is opened.

That line should not cause a problem. However, as Charles has advised, the code in such a procedure will only run automatically if that line of code is in the ThisDocument object of the document or of the template from which it was created.

Depending upon who is to be completing the "self grading document", you may run into issues with utilizing code as it will require that the document be saved as a Macro enabled document and for some of the users, your code may not run because of security settings on the user's computer.

What is function is the code intended to perform?
Honestly, I know nothing about coding and was just following a youtube video to create the document. I am creating a training system for my employer and we are including quizzes but they do not need to be self grading. But I would like to utilize the "developer" tab to create the quiz. Does this require any coding?

@kymichelle95 You can use the Content Controls on the Developer tab of the ribbon without necessarily using code to enhance their capability

 

Doug_Robbins_Word_MVP_0-1668800868248.png

 

See the following page of Greg Maxey's website:

 

https://gregmaxey.com/word_tip_pages/content_controls.html