Word To XL Help

ColinKJ

Well-known Member
Joined
Jan 27, 2009
Messages
983
Hi All,

I'm trying to help another Forum user<TABLE cellSpacing=1 cellPadding=4 border=0><TBODY><TR><TD class=thead>jm-darcy</TD></TR></TBODY></TABLE>with a problem, and now I've encountered a problem.

I'm using VBA in XL to identify a list of word files in a folder, then XL saves a text.file and then launches Word, a VBA in Word loads the text.file which contains the name of a Word document, which Word then Opens.

Are you keeping up with me?.

Now, the data I want to extract from the Word document is in a series of TextBox's.

While I can select all the TextBox's, I can find any way of extracting the text from them, not like XL.

I've tried various line of code to access the TextBox but without success.

Can anyone help me.

Regards

ColinKJ
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
if memory serves, textboxes in word are shapes or inline shapes, you can loop through each in the document to return the content (.range.text)
 
Upvote 0
Hi westconn1,

That's excellent.

ActiveDocument.Shapes("Text Box 3").Select
a = Selection.Range.Text

Works for me.

Thanks again.

ColinKJ
 
Upvote 0
Thanks westconn1,

Selecting items in code sometimes becomes a habit.

I need to make sure I try code without selecting first, and only do it if it doesn't work without.

Thanks again

ColinKJ
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top