Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Environ will do the trick:</p> <pre><code>debug.print Environ("ProgramFiles") debug.print Environ("PROGRAMFILES(X86)") 'If you want to check if current PC is x64 debug.print Environ("PROCESSOR_IDENTIFIER") </code></pre> <p>List of environment variables can be found <a href="http://technet.microsoft.com/en-us/library/cc749104%28WS.10%29.aspx">here</a>.</p> <hr> <p><strong>UPDATE</strong>: Based on the conversation I've had with Christian and based on my comments, I looked into this a little more.</p> <p>I have two machines I tested on:</p> <ul> <li><em>Machine 1</em>: Win 7 Ultimate, 64 Bit, Office 2010 64 Bit</li> <li><em>Machine 2</em>: Win 7 Ultimate, 32 Bit, Office 2007 32 Bit</li> </ul> <p>I ran the following statements in the immediate window:</p> <pre><code>? Environ("ProgramFiles") ? Environ("PROGRAMFILES(X86)") ? Environ("ProgramW6432") </code></pre> <p><strong>Results</strong></p> <p>Machine 1:</p> <pre><code>C:\Program Files C:\Program Files (x86) C:\Program Files </code></pre> <p>Machine 2:</p> <pre><code>C:\Program Files //Blank// //Blank// </code></pre> <p>So, based on these limited findings, you may want to see the if <em>ProgramW6432</em> has a value. If not, assume 32 bit and use <em>ProgramFiles</em>. </p> <pre><code>IF Environ("ProgramW6432") &lt;&gt; "" THEN 'I'm 64 bit so check both ProgramW6432 and PROGRAMFILES(X86) ELSE 'I'm 32 bit so check ProgramFiles END IF </code></pre> <p>Conversely, you could use PROCESSOR_IDENTIFIER to determine x64 vs. x86 and do the same thing.</p> <p>I wouldn't say either way is foolproof but should get you on the right track.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload