vba - Shape Variable Loses Reference to Some Shape Properties When the Selection is Changed -


i using vba in microsoft word manipulate shapes. have instance variable loses reference shape properties when selection changed. following code. when code begins run, picture selected in document. picture regular shape (i.e. not inline shape):

dim myshape shape set myshape = selection.shaperange(1) msgbox myshape.left selection.collapse msgbox myshape.left 

the first msgbox command works fine, second 1 after collapsing selection causes following error:

"run-time error '4605': left method or property not available because drawing operation cannot applied current selection."

the same thing happens if try access myshape.top after collapsing selection. weird if try access myshape.width or myshape.height after collapsing selection, works fine. insight appreciated.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -