Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6738841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:24:59+00:00 2026-05-26T11:24:59+00:00

Often when describing an issue in code, I need to reference it by line/column/function.

  • 0

Often when describing an issue in code, I need to reference it by line/column/function.
Is there a macro/add-in for Visual Studio that copies that information for me?

It would be perfect if it could copy to clipboard: File, Line, column, function name

But I’d take any combination :).

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:25:00+00:00Added an answer on May 26, 2026 at 11:25 am

    I ended up doing a macro. Unfortunately I was unable to access the clipboard from the macro so I had to use NirCmd for that part. Other than that, it works great!

    Public Sub CopyLocation()
    
        Dim fileName = DTE.ActiveDocument.Name
        Dim line = ""
        Dim column = ""
        Dim functionName = ""
        Dim className = ""
    
        Dim textDocument = TryCast(DTE.ActiveDocument.Object, TextDocument)
        If textDocument IsNot Nothing Then
    
            Dim activePoint = textDocument.Selection.ActivePoint
    
            column = activePoint.DisplayColumn
            line = activePoint.Line
    
            Dim codeElement As CodeElement
    
            codeElement = activePoint.CodeElement(vsCMElement.vsCMElementFunction)
            If codeElement IsNot Nothing Then
                functionName = codeElement.Name
            End If
    
            codeElement = activePoint.CodeElement(vsCMElement.vsCMElementClass)
            If codeElement IsNot Nothing Then
                className = codeElement.Name
            End If
    
        End If
    
        Dim output As String = String.Format("File: {0} ", fileName)
        If (String.IsNullOrEmpty(line) = False) Then output = output & String.Format("Line: {0} ", line)
        If (String.IsNullOrEmpty(column) = False) Then output = output & String.Format("Column: {0} ", column)
        If (String.IsNullOrEmpty(className) = False) Then output = output & String.Format("at {0}", className)
        If (String.IsNullOrEmpty(functionName) = False) Then output = output & String.Format(".{0}", functionName)
    
        Dim process As System.Diagnostics.Process
        process.Start("c:\NoInstall files\nircmd.exe", String.Format("clipboard set ""{0}""", output))
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Often we need to add a non-nullable column to a table, and it is
Often times applications will need some database code tables (aka reference tables or domain
Often time I need to add a control to a dialog after the dialog
Often, programmers write code that generates other code. (The technical term is metaprogramming ,
Often I just need to get a single value from MySQL that I know
Often I add helper functions to my PHP that return complex HTML. For example,
So, I often have trouble describing a function in a succinct name. It's usually
Often in code I see a line of code, I have an idea it
Often times a developer on my team will create a new Visual Studio project
Often I find myself filling ASP.NET repeaters with items that need the CSS class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.