|
-
Jan 10th, 2006, 05:13 AM
#1
Thread Starter
Lively Member
Retrieving the picture position
Problem retrieving the selected picture's Left and Top position
I use word automation in my VB6 appl.
I have a word doc open
Set AppWord = createObject("Word.Application")
So i use AppWord var to get to the word doc picture like
'Remark, the added picture has selection.type = 8
Dim Tbox as Shaperange
Set Tbox = AppWord.Selection.Shaperange
'Now a procedure is triggered when the user clicks on a picture in the word doc
I just want to retrieve te selected picture.
I do check if a picture is selected (by checking it's name)
Then i just retrieve its position
Links = Tbox.left
Boven = Tbox.top
This looks simple straightforword code.
Sometimes this works but often i get an error from Word 'Micr word has encountered a problem and needs to close. I get window with buttons 'Debug, Send Error report, Don't Send. And then i push Don't send and Word CLoses.
Strange thing is when i use the exact same code but on a textboxshape, i can allways gets the Left and Top value without any problem. What am i doing wrong here, or is there a Word Bug??
I know the commandline with Tbox.left causes the error.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|