Global predefined variables

<< Click to Display Table of Contents >>

Navigation:  Reference > Modules, Conditional Output & Variables > Variables and Conditional Output >

Global predefined variables

With the exception of Automating Publishing Jobs, these variables can be used everywhere in your project where variables are supported, including topics, headers, links, the TOC, scripts, macros and all HTML templates. See Using Variables for details, and Date and Time Variables for information on date and time formatting options.

All the date and time variables use the corresponding date and time formats set in the Windows configuration on the computer on which you are running Help+Manual.

Variable

Content and/or function of the variable

<%AUTHOR%>

The name of the author of the help defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%COPYRIGHT%>

The copyright statement defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%DATE%>

The current date in short format, without the time. The format matches the language set for your project. Supports manual formatting options that allow you to configure how the date is displayed.

Returns the month in genitive form in applicable languages.

<%DATELONG%>

The current date in long format. The language and format are generated automatically to match the language set for your project. This automatically includes long month names, in the genitive form in applicable languages. No manual formatting options.

<%HMFIGURECOUNTER%>
<%HMTABLECOUNTER%>

Counter variables for figures and variables. Unlike user-defined counter variables, these variables can be referenced to create references like "See Fig. X".

Important: Counter variables cannot be used in the table of contents.

<%MONTHNAME%>

The current month in long format (i.e. February, not Feb or 2). The format matches the language set for your project.

<%NOW%>

The current date and time. The language and format are generated automatically to match the language set for your project. Supports manual formatting options that allow you to configure how the date and time are displayed.

Returns the month in nominative form in applicable languages.

<%OUTPUTFILEDIR%>

The absolute Windows-style output path of the current build, without a trailing backslash.

<%OUTPUTFILENAME%>

Name of the output file for the current build, without path or other information. For example, if you are publishing to CHM it will be the name of the CHM file, if you are publishing to HTML it will be the name of the main HTML file (normally index.html unless you change it), and so on.

<%OUTPUTFILEPATH%>

The absolute Windows-style output path of the current build, including a trailing backslash.

<%SELF%>

The name of the current project file without path or extension.

<%SELFFULLNAME%>

The name of the current project file including the file extension and the full path to the project directory, as displayed in the Help+Manual title bar. This can be useful for documenting which project version you have used to generate your documentation.

<%SUMMARY%>

The Summary text for the project defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%TARGETTITLE%>

This is a special variable that can only be used in the captions of topic hyperlinks. When used there it will automatically insert the current title of the target topic of the link as the caption when you publish your project. See Inserting topic links for details.

<%TIME%>

The current time in short format. The format matches the language set for your project. No manual formatting options.

<%TIMELONG%>

The current time in long format. The format matches the language set for your project. No manual formatting options.

<%TITLE%>

The title of the help project defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%TOPICHELPCONTEXT%>

Help context number(s) assigned to the current topic

<%TOPICLASTEDITED%>

The date when the topic containing the variable was last edited in short format.  Supports manual formatting options that allow you to configure how the date and time are displayed.

Returns the month in nominative form in applicable languages.

<%TOPICLASTEDITEDTIME%>

The time when the topic containing the variable was last edited. The format matches the language set for your project.

<%TOPICLASTEDITEDUSER%>

Name of the user who last edited the current topic.

<%TOPICMETA:NAME%>

Special variable for use in topics only. Inserts the values of meta tags added to the XML source of topic files. Currently only relevant for Sandcastle import, where Help+Manual inserts a meta tag with hash value to check whether existing sandcastle topics have been changed or not. (Have a look at the XML source of imported Sandcastle topics to see this.) However, it will also work on your own meta tags if you add them to the XML yourself.

Usage: Replace "NAME" with the name of the XML meta tag you want to reference.

<%TOPICSTATUS%>

Status of the current topic.

<%TOPICTITLE%>

Title text of the current topic.

Important:
Don't confuse this with the<\%TOPIC_TITLE%> variable with an underscore in the middle, which only works correctly in HTML templates.

<%VERSION%>

An automatically-generated combination of the Major, Minor and Build version variables, with dots between the versions. For example, if Major=3, Minor=25 and Build=329 then <%VERSION%> will be 3.25.329.

<%VERSION_BUILD%>

The Build Version text for the project defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%VERSION_MAJOR%>

The Major Version text for the project defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%VERSION_MINOR%>

The Minor Version text for the project defined in Project Explorer > Configuration > Common Properties > Title & Copyright.

<%YEAR%>

The current year in 4-digit format. No manual formatting options.

See also:

Date and Time Variables

Using Variables

Using HTML Templates