Open Primary .rc File As Text

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

The following macro opens the primary .rc file as text.

Sub OpenRCFile()
‘DESCRIPTION: Opens the primary .rc file as text
‘NOTE: If the resource file is already open within the
‘ resource editor, you may be asked if you wish to
‘ close it.

‘ Simply strip the project filename of its extension…
‘ …and replace it with "rc"
If Projects.Count = 0 Then
MsgBox “Load a project first.”
Exit Sub
End If
PathName = ActiveProject.fullname
PathName = Left(PathName, Len(PathName)-3)
PathName = PathName + “rc”
Documents.Open PathName, “Text”
End Sub

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read