Blackouts in recent years have demonstrated that a reliable and secure power system is a key component of an efficient economy. Therefore control devices such as flexible AC transmission system devices (FACTS) are placed in the system and utilised to improve the security of the system. A method to determine appropriate settings for these devices is optimal power flow control. As the area of influence of a FACTS device is usually limited, it is sufficient to include only a reduced area in the optimisation problem. Here, such an optimal power flow problem is formulated where the considered area is defined using sensitivity analysis. To include N - 1 security as an objective, a current injection method is applied, which facilitates the determination of the system state in the case of a line outage, without having to carry out a full-load flow simulation.