This paper develops an open economy model with heterogeneous final goods producers who simultaneously choose whether to export their goods and whether to use imported intermediates. The model highlights mechanisms whereby import policies affect aggregate productivity, resource allocation, and industry export activity along both the extensive and intensive margins. Using the theoretical model, we develop and estimate a structural empirical model that incorporates heterogeneity in productivity and shipping costs using Chilean plant-level data for a set of manufacturing industries. The estimated model is consistent with the key features of the data regarding productivity, exporting, and importing. We perform a variety of counterfactual experiments to assess quantitatively the positive and normative effects of barriers to trade in import and export markets. These experiments suggest that there are substantial aggregate productivity and welfare gains due to trade. Furthermore, because of import and export complementarities, policies which inhibit the importation of foreign intermediates can have a large adverse effect on the exportation of final goods.