Get Friend File
Posted
by Per Nilsson
on February 2nd, 1999
Quite lo-tech but useful never the less.
Sub GetFriendFile() 'DESCRIPTION: Opens the corresponding .h / .cpp file currentFileName = Application.ActiveDocument.FullName newFileName = "" if (Ucase(Right(currentFileName,2))=".H") then newFileName = Left(currentFileName,Len(currentFileName)-2)+".CPP" elseif (Ucase(Right(currentFileName,4))=".CPP") then newFileName = Left(currentFileName,Len(currentFileName)-4)+".H" end if if newFileName<>"" then Application.Documents.Open newFileName End Sub
Date Last Updated: February 3, 1999

Comments
Added Error Processing
Posted by Legacy on 04/03/2000 12:00amOriginally posted by: Mark Jordan
Replyimproved version of the above
Posted by Legacy on 12/02/1999 12:00amOriginally posted by: Amir Lopatin
ReplyAll "Toggle CPP/H" macros crash DevStudio
Posted by Legacy on 02/03/1999 12:00amOriginally posted by: Jean-Paul Retru
I test all of macros who toggle between CPP and H files.
All of them crash DevStudio 6.0.
GetFriendFile too.
I remember that the first test I do with these macros was with VC5.0 and DevStudio crash too.
I think the crash is associated with MSDN viewer.
Regards.
Reply