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

CurrentDirectory

Status
Not open for further replies.

Morpheus1981

Programmer
Aug 9, 2001
105
CR
I am building a MS Word add-in with C#.
As part of my project I add a word template "MyDemo.dot" that is going to be in the same directory that my Add-in is being install.

After it has been installed I need to know where my template was placed, I mean the path, for instance "c:\demo\MyDemo.dot".
I used "Path and Directory" classes but both gave me where my MS Word app was installed. I need to know the path to my Add-In.

Thanks
 
Do you need to know the path from which your compiled application is run from ?
If so then make use of : string pathStr = Application.StartupPath; [does exactly what it says on the tin... ;)]
I apologise if I've misunderstood the question on this. :(
Steve
 
Yeah,
I allready try "Application.StartupPath". What happens is that it gives me a path that is not a right one. It always returns a path point to my desktop but it is not there where my add-in is intalled.


Thanks a lot for ur help
 
Is it a shortcut you're using on the desktop or is it the actual application itself that you have there - hence the computer claiming that this is the start up path.
Can you ensure that you have the application file in an appropriate place (along with the files you need to reference) and then create a shortcut on the desktop ?
I hope I'm not missing the point on this one. :(
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top