We present the results of a Monte-Carlo study of the sensitivity of the planned IceCube detector to predicted fluxes of muon neutrinos at TeV to PeV energies. A complete simulation of the detector and data analysis is used to study the detector's capability to search for muon neutrinos from sources such as active galaxies and gamma-ray bursts. We study the effective area and the angular resolution of the detector as a function of muon energy and angle of incidence. We present detailed calculations of the sensitivity of the detector to both diffuse and pointlike neutrino emissions, including an assessment of the sensitivity to neutrinos detected in coincidence with gamma-ray burst observations. After three years of datataking, IceCube will have been able to detect a point source flux of E2*dN/dE = 7*10^-9 cm^-2s^-1GeV at a 5-sigma significance, or, in the absence of a signal, place a 90 percent c.l. limit at a level E2*dN/dE = 2*10^-9 cm^-2s^-1GeV. A diffuse E-2 flux would be detectable at a minimum strength of E2*dN/dE = 1*10^-8 cm^-2s^-1sr^-1GeV. A gamma-ray burst model following the formulation of Waxman and Bahcall would result in a 5-sigma effect after the observation of 200 bursts in coincidence with satellite observations of the gamma-rays.