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

  • SEARCH
  • Home
  • 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 8427243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:44:05+00:00 2026-06-10T04:44:05+00:00

I am doing Word automation in C#. I want to move current cursor position

  • 0

I am doing Word automation in C#. I want to move current cursor position to selected line number.

Let me explain with an example:

Line 1
Line 2
Line 3
Line 4

Line 6
Line 7

Now I have purposely left Line 5 blank. After Line 7, I want to move cursor to Line 5. I am using oWord.Selection.Range method, but no luck so far.

  • 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-06-10T04:44:06+00:00Added an answer on June 10, 2026 at 4:44 am

    Well It seems no one found any thing.Let me help my self and others who might face this problem

    well the logic here is that,every time you move your cursor to the top of the position,here Line 1

       WRange.Range Myrng = oDoc.Range(ref StartPos, ref Endpos);
                       Myrng.Select();
    
                       object Story = WdUnits.wdLine;
                       oWord.Selection.EndKey(ref Story, ref extend);
    
                       object NewEndPos = oWord.Selection.End - 1;
                       Myrng = oDoc.Range(ref NewEndPos, ref NewEndPos);
                       Myrng.Select();
    

    after this point the output is something like Line 1 I
    now I will move the cursor to Line 5 for that

                       object Count=5;
                       oWord.Selection.MoveDown(ref unit, ref Count, ref oMissing);
    

    And Voila here you are to Line Number 5

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're currently doing some Word automation, and want to be able to insert a
I'm doing a mail-merge in Word 2010 with an Excel 2010 file as the
We are doing an app to manage and print Word, Excel, PowerPoint, and PDF
Does anyone have any experience with doing mail merge from Java on a word
In my project which I'm doing, I have to find if my word document
I am doing some word wrapping in my tableview as some of the values
I am doing extensive work with a variety of word lists. Please consider the
Just doing some research on searching for a character or word within a NSString
CSS word-spacing property for input elements not working in Opera Am I doing something
Is there any advantage in doing bitwise operations on word boundaries? Any CPU or

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.