Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:33:00+00:00 2026-06-13T14:33:00+00:00

I am writing a template in Word 2010 which is based upon another template,

  • 0

I am writing a template in Word 2010 which is based upon another template, both of which contain considerable amounts of VBA code. I have referenced the original template to access its modules. Are global variables in the original template also accessible this way? If so, is there a coding standard to access them, such as:

TheTemplate.VariableName

or can they just be accessed by name:

VariableName
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:33:02+00:00Added an answer on June 13, 2026 at 2:33 pm

    Each template is a closed object. None of the variables global to it a template’s modules will be accessible or visible to any other template that is currently loaded.

    What you can do is add public properties to a document object. Add them to the “ThisDocument” class module every document has, for example a string property like this:

    Public Property Get Foo() As String
      Foo = "Any value"
    End Property
    

    Now you can access that property from anywhere, as it will be exposed by that Document object:

    MsgBox Application.Documents("appropriate document reference").Foo
    ' alerts "Any value"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a T4 template in Visual Studio 2010 and am generating code based
I'm writing a Word/VBA macro for a document template. Every time a user saves/creates
I am writing a template class which takes a floating-point-like type (float, double, decimal,
Does anyone have a template for writing a decent equals method - I remember
I am writing a paper using the ACM template which capitalizes every letter in
I'm writing a template class which should take an array as its type. public
I am currently writing a template for OpenCms, a Java based CMS with a
I'm writing a template for which I'm trying to provide a specialization on a
I am writing a simple Word Interop application which open a .doc file in
I'm writing a template class and at one point in my code would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.