Ultrabroadband millimeter-wave and subterahertz waveforms offer significant potential, from ultrahigh-speed communications to high-resolution radar. Electronic generation of broadband arbitrary waveforms at these frequencies suffers from limited digital-to-analog converter speed and high timing jitter. Photonic-assisted techniques, such as those based on optical shaping and frequency-to-time mapping, can overcome these difficulties. Nevertheless, previous photonic arbitrary waveform generation demonstrations are confined to microwave and low millimeter-wave frequencies due to limited optical-to-electrical conversion bandwidth. Here, by utilizing cutting-edge photodetector technology, we report the first generation, wireless transmission, and measurement of substantially complex and highly stable arbitrary waveforms in the W-band (75–110 GHz). These waveforms exhibit high time-bandwidth products up to 600, arbitrarily extendable repetition periods, and phase-noise performance substantially better than state-of-the-art electronic arbitrary waveform generators. The utility of the generated waveforms is demonstrated in multi-target ranging, where a depth resolution of 3.9 mm, unprecedented in the W-band, is achieved over more than 5 m.