DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   Help getting txt value from Word selection.copy (http://www.daniweb.com/forums/thread157729.html)

gggchurch Nov 16th, 2008 4:44 pm
Help getting txt value from Word selection.copy
 
I've searched for an answer but cannot find one so excuse me if this has been answered.

This is in Word 2003.

I have a two column table. The macro in question runs from the right column, selects the name of a file from the same row left column and then inserts the contents of that file into the cell it originated in and moves down one cell.

Problem is I cannot get the value of the file name from the select.copy performed on the left cell to asign it to a variable to be included in the selection.insertfile method.

I've tried using DataObject but this is not supported (Compile Error: User defined type not defined).

Any help appreciated.

ggg

gggchurch Nov 17th, 2008 8:37 pm
Re: Help getting txt value from Word selection.copy
 
Hate to answer my own question but...

strvar = selection.text

gets the value into a variable...
Now for some reason insert.file will not find the file name, with complete path in macro mode. I works fine manually but...

oh, well...


All times are GMT -4. The time now is 10:25 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC