Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

Populate a VBA variable from text on the page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
danhattan - 02 Aug 2007 22:46 GMT
I'm currently copying a text with numbered verses in each chapter from a web
site and pasting to Word. There are three translations of each verse. I
created a Do loop to remove 2 of the translations from each verse. The loop
length is controlled by an integer variable I populate via an InputBox
function.

It occurred to me that it would be easy enough to capture that number after
the paste (it's the number of the last verse), and then put it into the code
itself and dispense with the input box. Sort of. I can get the cursor to
locate that number and select it, but I'm stumped as to how to get that
number into the VBA code to populate the variable.

If anyone knows how to do this, much appreciated if you could share. Thanks.
Jonathan West - 02 Aug 2007 23:18 GMT
> I'm currently copying a text with numbered verses in each chapter from a
> web
[quoted text clipped - 14 lines]
> If anyone knows how to do this, much appreciated if you could share.
> Thanks.

numVerse = Val(Selection.Text)

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

danhattan - 02 Aug 2007 23:50 GMT
Sweet. And Simple. Mucho Merci!

> > I'm currently copying a text with numbered verses in each chapter from a
> > web
[quoted text clipped - 16 lines]
>
> numVerse = Val(Selection.Text)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.