This paper presents a novel flexible structure for microwave and millimeter-wave photonic filters, integrating automatic modulation conversion and optical frequency comb shaping schemes. Through automatic modulation type and level adjustment during optical line-by-line frequency comb shaping within an interferometric configuration, the microwave and millimeter-wave photonic filters can achieve passband bandwidth programming and center frequency tuning across a significantly wide frequency range. Automatic modulation conversion is implemented by linking an automatic bias-controlling loop to a dual-parallel Mach-Zehnder modulator. Herein, we experimentally demonstrate a tunable and programmable microwave and millimeter-wave photonic filter, exhibiting a maximum center frequency and bandwidth of 105 GHz and 5.25 GHz at 3 dB, respectively. To clarify the versatility of these filters as key components for next-generation wired and wireless networks, we also implemented flexible multi-passband filters capable of accommodating up to four passbands. This feature enables the component to integrate the functions of filtering, up/down conversion, and data aggregation. This innovation is expected to lead to significant advancements in terms of hyper-connected ultra-broadband wired and wireless networks.