Recent experimental and theoretical progress in the studies of Bose-Einstein condensation (BEC) has precipitated an intense effort to understand and control interactions of nonlinear matter-waves. Key ingredients in manipulations of matter-waves in BECs are a) external localized impurities (generated by focused laser beams) and b) periodic potentials (generated by interference patterns from multiple laser beams illuminating the condensate). In this work we demonstrate the ability of time-dependent external optical potentials to drag, capture and pin a wide range of localized BEC states, such as dark and bright solitons. The stability and existence of pinned states is analyzed using perturbation techniques, which predict results that are well corroborated by direct numerical simulations. The control of these macroscopic quantum states has important applications in the realm of quantum storage and processing of information, with potential implications for the design of quantum computers.