473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

VS AddIn - Line Number in ActiveDocument

I am currently working on a Visual Studio add-in. Does anyone know of
a simple way to get the line number the cursor is on in the
ActiveDocument? I don't necessarily need full code as long as someone
can point me in the right direction. Thanks in advance.

Ken Wilson
Seeking viable employment in Victoria, BC
Nov 17 '05 #1
3 2917
http://msdn.microsoft.com/library/de...l/win32map.asp

??
hope that helps some :)
"Ken Wilson" <kw*********@NOshaw.SPAMca> wrote in message
news:4r********************************@4ax.com...
I am currently working on a Visual Studio add-in. Does anyone know of
a simple way to get the line number the cursor is on in the
ActiveDocument? I don't necessarily need full code as long as someone
can point me in the right direction. Thanks in advance.

Ken Wilson
Seeking viable employment in Victoria, BC

Nov 17 '05 #2
On Mon, 31 Oct 2005 15:00:28 -0600, "Raj Chudasama"
<raj@asteriasgi_spamkiller.com> wrote:
http://msdn.microsoft.com/library/de...l/win32map.asp

??
hope that helps some :)
"Ken Wilson" <kw*********@NOshaw.SPAMca> wrote in message
news:4r********************************@4ax.com.. .
I am currently working on a Visual Studio add-in. Does anyone know of
a simple way to get the line number the cursor is on in the
ActiveDocument? I don't necessarily need full code as long as someone
can point me in the right direction. Thanks in advance.

Ken Wilson
Seeking viable employment in Victoria, BC

That was a little more than I was looking for in regards to a running
Visual Studio but I have bookmarked it for future reference. I was
able to find similar code to what I needed for working with the Visual
Studio object. I'm posting it here in case anyone looks this thread
up seeking an answer. Thank you for your help.

---

object _applicationObject = (DTE2) Application; // passed by VS

....

int lineNumber;

lineNumber = ((TextSelection)
_applicationObject.ActiveDocument.Selection).Curre ntLine

---

Ken Wilson
Seeking viable employment in Victoria, BC
Nov 17 '05 #3
Hi Ken,

For the future, there are better newsgroups for add-ins questions such as
the following:

microsoft.public.vsnet.ide
microsoft.public.vstudio.extensibility

Not to mention the excellent Yahoo group for .NET add-ins (free join):

http://groups.yahoo.com/group/vsnetaddin/

Also, you have lots of resources for add-in developers at my web site:

http://www.mztools.com/resources_addin_developers.htm

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ken Wilson" <kw*********@NOshaw.SPAMca> escribió en el mensaje
news:4r********************************@4ax.com...
I am currently working on a Visual Studio add-in. Does anyone know of
a simple way to get the line number the cursor is on in the
ActiveDocument? I don't necessarily need full code as long as someone
can point me in the right direction. Thanks in advance.

Ken Wilson
Seeking viable employment in Victoria, BC

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
6
by: Illya Havsiyevych | last post by:
Hello I'm trying to create VB IDE AddIn by using MS VS 6.0 SP5 with VB. Registering it, startup Access, do Load and get Type mismatch error What it can be ? Also was trying to create the...
6
by: jchao123 | last post by:
Dear All, I have an MDB file (Access 2000/XP) which contains generic routines I use in various apps (eg, API calls, File access classes etc). I have compiled into an MDE file which I reference...
0
by: guilligan.geo | last post by:
Hello, I'm trying to create an addin for Outlook 2002 using the one provided in the demo of win32com as a starting point. I've been able to do my addin and test it if I go the "standard" way...
7
by: Joseph Geretz | last post by:
I've been working on an Addin for Outlook in C#. It hasn't been long now, just a couple of days. Suddenly though, running my project in Debug launches Outlook as specified, but no breakpoints...
6
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook...
1
by: AlexZh | last post by:
Hi, I'd like to stop command line build by one project build failed. To do that I've created simple AddIn (see code below), that works fine for IDE and does not work for command line. In the AddIn...
0
by: kedarv | last post by:
i have created a word addin in .net 2003. i am using word 2003 but following line gives error whenever i open an existing document: CType(applicationObject, Word.Application).CustomizationContext =...
3
by: Alexander Vasilevsky | last post by:
Seeking an example of using System.AddIn.Hosting Namespace http://www.alvas.net - Audio tools for C# and VB.Net developers
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.