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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Application path

Status
Not open for further replies.

Viruland

Programmer
Dec 6, 2000
61
BE
In my program I need to open Word files from different network locaties and each of these files must be opened with the Word application of that network location. Is there a way to set the startup location of an application. I know that I can use a Shell function but that isn't suitable for my program.

I've created an Word.Application Object and I want to assign the correct application path to it.

example:

public objWord as object

public sub OpenDoc (docName as String, docLoc as Integer)

set objWord = createObject ("Word.Application")
select case docLoc
case 1
path = "C:\Program Files\Microsoft Office\Office\winword"
case 2
path = "F:\Program Files\Microsoft Office\Office\winword"
case 3
path = "G:\Program Files\Microsoft Office\Office\winword"
case 4
path = "H:\Program Files\Microsoft Office\Office\winword"
case else
path = "I:\Program Files\Microsoft Office\Office\winword"
end select

Is there a way to set the path to my Object?

Live fast, die young and leave a beautiful corpse behind.
 
Just get the objWord.Path property - that will return the default Office path.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top