This paper proposes an approach for optimal power flow with incorporation of preventive and corrective control. The approach is useful for operation planning to guarantee secure operation under both normal and contingency states. Therefore, the approach consists of main problem and sub problem representing normal and contingency states, respectively. In normal state, preventive control is used to secure the system while in contingency state, corrective control is employed to satisfy system constraints. The objective of main problem is to minimize operation cost while the sub problem is aimed to minimize power generation deviation in order to avoid ramp rate violation. The approach uses iterative process involving normal and contingency states. At contingency state, power redispatch is conducted as corrective control to avoid system violation. If power redispatch violates ramp rate of generator unit, the exceeding power will be fed back to normal state to recalculate the generator output in the normal state. This calculation in normal state is called as preventive control. To show the effectiveness of the proposed approach, IEEE 9 bus system and modified Jawa Bali 25 Bus system is used. The result shows that the proposed approach is able to secure the operation under both normal and contingency states.