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

App.Path

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Jan 27, 2003
890
GB
Is there a method compatible with .oft files (Outlook forms templates) and VBS that will on launch return the file’s file path? I’ve tried ‘App.Path’ & ‘Item.Path’ to no avail.

I’m placing these files on a number of common drive on the company network in order for them to be accessible to staff. I find however that staff tend to save these files else where, resulting in there not use the latest version (should this form have been updated). I would like to use something along the lines of the following:
Code:
Function Item_Open()

If App.Path <> sPath then
	Item.Delete
	Exit Function
End If

End Function

Everybody body is somebodys Nutter.
 
Hello CluelessChris,

Use .Parent which return the folder in which the item is stored, whereas for an unsaved item, it retures the default folder. From this folder object, you can get the path. Hence, something like:
Code:
If Item.Parent.Path <> sPath then
    Item.Delete
    Exit Function
End If
regards - tsuji
 
tsuji

Thanks for the help but with your method I get the error &quot;Does not support the object or method 'Item.Paren.Path' ???

Everybody body is somebodys Nutter.
 
Hello again,

I'm most probably on the wrong side as item so created by createitemfromtemplate might not have the parent property like mail/post items. (But, when using that create... method, would the folder already injected into the parameter? I wonder...)

Also wonder if Application.ActiveExplorer.CurrentFolder folder object would serve you any good?

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top