Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining Location of Office Directory

Status
Not open for further replies.

PBAPaul

Programmer
Joined
Aug 3, 2002
Messages
140
Location
GB
I have been using VBA code to load references for projects. An example is below.

Code:
With ActiveWorkbook.VBProject.References
 .Remove ThisWorkbook.VBProject.References("Microsoft Outlook 10.0 Object Library")
 strReference = "c:\program files\microsoft office\office10\msoutl.olb"
 .AddFromFile strReference
End With

This has worked fine until I came across a system where the MS Office files were located on drive E!

Is there any VBA trick to quickly locate the MS Office directory? I can always do a VBA search for the directory but I know there are API calls to find the Windows directory and I wonder if anyone has a quick way of finding the MS Office directory?

Thanks in advance.
Paul
 

Try:

[tt]Application.Path[/tt]

*cLFlaVA
----------------------------
When will I be able to see what other members can see about myself? It's been like, a freakin' month already!
 
Oh what an idiot I am!

I had completely forgotten about this. Thanks for the reminder!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top