UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Move To A Specific Paragraph Number, Office 2003    
 
   
alysolyman1971
post Apr 7 2017, 05:30 PM
Post#1



Posts: 23
Joined: 2-February 14



Good evening,

Is there any VBA code that moves the selection (cursor) to specific paragraph based on paragraph number (or index)?

Best Regards
Go to the top of the page
 
GroverParkGeorge
post Apr 8 2017, 06:57 AM
Post#2


UA Admin
Posts: 31,216
Joined: 20-June 02
From: Newcastle, WA


If you have specific numbering, or bookmarks, in place, yes, you could do that with VBA. However, Word documents are basically unstructured in the sense that inserting or deleting sections of text can be done at any point, for any amount of text. So, unless you have inserted some sort of bookmark, it's not likely you could do this.

That said, if you DO have bookmarks at the beginning of each paragraph, then you can use VBA to move to any given bookmark. To create this VBA, record a macro in which you move to one bookmark, then edit the resulting VBA as needed to make it more generic.

--------------------
Go to the top of the page
 
alysolyman1971
post Apr 8 2017, 08:53 AM
Post#3



Posts: 23
Joined: 2-February 14



I have no bookmarks. only paragraph number. I suppose that some (Goto) command can do.

Or;
I hope some VBA code will work on all available paragraphs. so it will go to first paragraph then reads the paragraph number if paragraph number is matching my pre-determined value it will stop otherwise, it will move to the next paragraph.
Go to the top of the page
 
GroverParkGeorge
post Apr 8 2017, 08:56 AM
Post#4


UA Admin
Posts: 31,216
Joined: 20-June 02
From: Newcastle, WA


Yes, that should work. If the paragraphs are numbered, and if those paragraph numbers are static, not dynamically generated, using the Goto command should work nicely.

I would start by recording a macro of what you need to do, then examine the resulting sub to see how much customization it needs to be made generic for other searches.

--------------------
Go to the top of the page
 
alysolyman1971
post Apr 8 2017, 09:14 AM
Post#5



Posts: 23
Joined: 2-February 14



Thanks a mile. Awaiting!!!
Go to the top of the page
 
GroverParkGeorge
post Apr 8 2017, 09:16 AM
Post#6


UA Admin
Posts: 31,216
Joined: 20-June 02
From: Newcastle, WA


Sorry, I meant that is what I would do in your place, not what I am going to do.

Try it out. Let us know your results.

--------------------
Go to the top of the page
 
alysolyman1971
post Apr 8 2017, 11:18 AM
Post#7



Posts: 23
Joined: 2-February 14



Resolved the issue but in a very indirect way.


thanks a lot for your cooperation
Go to the top of the page
 
rony albert
post Apr 11 2017, 07:47 PM
Post#8



Posts: 2
Joined: 1-April 17



I am little confused about it. Would you please share its visuals to make it more easy to understand. Thanks
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    14th December 2017 - 11:27 PM