Jump to content

Recommended Posts

Posted (edited)

Okay I've hacked down a large program to illustrate the problem I'm having.

I'm using the built-in Word UDF (which is great) and am finding a range and then copying it to the clipboard and sticking it in an array for viewing.

Then extending the range and again copying it to a clipboard and sticking it into the array.

It seems to drop the ranges randomly.  I can't figure out what I'm doing wrong (or if there's a better way to get a range into a variable).

Run the program with the test file and you'll see entries being dropped (put test file in same directory as the program).

Any pointers or help much appreciated.

Hacked down program for testing Range extend and copy v3c.au3Fetching info...

Test for Range Copy v1a.docxFetching info...

Edited by ahha
solved
Posted

Why do you use the Clipboard? Couldn't you just copy the text to the array?
I would replace

$oRangeFound.Copy   ;v3c copy to clipboard
    $clip = ClipGet()
    $aFilenames[$count][0] = $clip

with

$aFilenames[$count][0] = $oRangeFound.Text

 

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

water,

Thank you.  :)

Using .Text seems to work fine.  It looks like either .Copy and/or ClipGet() are the intermittent culprits.

BTW - is there a list somewhere of the dot operations like .Text ?  I'm still learning (always).

Posted

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Edit the first post in this thread and edit the title.

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...