Macro To Switch Between Header and Cpp File

This is a simple macro to allow you to switch between the header and cpp file.


Sub Jump()
'////////////////////////////////////////////
'Nooruddin Kapasi 1998.
'DESCRIPTION: Switch Between Header and cpp
'////////////////////////////////////////////
Dim myDocument
Dim a
Dim b
Dim Flag
Dim Flag1
Flag1 = 0
Flag = 1
a = ActiveDocument.FullName
tmp = InStr(a, ".cpp")
If tmp Then
        b = Left(a, Len(a) - 3) + "h"
        Flag1 = 1
Else
tmp = InStr(a, ".h")
If tmp Then
        b = Left(a, Len(a) - 1) + "cpp"
        Flag1 = 1
End If
End If
For Each myDocument In Application.Documents
    If myDocument.FullName = b Then
        myDocument.Active = True
        Flag = 0
        Exit For
        End If
Next
If Flag And Flag1 Then
        Documents.Open b, "Text"
End If
End Sub



Comments

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds