I know that I can look into properties,TargetPath, TargetDir, TargetFileName, by right clicking on a project and checking out it's properties but I need to do this programatically. Any help would be very much appreciated.
You can get such properties (using the selected startup project as an example) starting with the following code:
Project startupProject = DTE.Solution.Item(((DTE.Solution.SolutionBuild as SolutionBuild2).StartupProjects as object[])[0]);
Properties p = startupProject.ConfigurationManager.ActiveConfiguration.Properties;