Vitaly Pshenichnii
asked on
Control picture in text box
I place signature picture to textbox programmatically using bookmark and try to control it'sdeletetion by user with AlternativeText property.
Here Power Builder script:
If lole_Word.ActiveDocument.B ookmarks.E xists("sig nature_ima ge") = True Then
lole_Word.ActiveDocument.B ookmarks.I tem("signa ture_image ").Select( )
lole_Word.Application.Sele ction.Inli neShapes.A ddPicture( is_sign_fi lename, False, True)
ll_count = lole_Word.ActiveDocument.I nlineShape s.Count
if ll_count > 0 then lole_Word.ActiveDocument.I nlineShape s[ll_count ].Alternat iveText=_' sign_image _name' lole_Word.ActiveDocument.B ookmarks.I tem("signa ture_image ").Delete( )
end if
End If
But ll_count does not changes and new picture does not appears in This.ole_word.Object.Appli cation.Act iveDocumen t.Shapes[] .
How I can control if signature picture exists in document?
There is no problem when I pplacing picture to main document, only with textbox.
Here Power Builder script:
If lole_Word.ActiveDocument.B
lole_Word.ActiveDocument.B
lole_Word.Application.Sele
ll_count = lole_Word.ActiveDocument.I
if ll_count > 0 then lole_Word.ActiveDocument.I
end if
End If
But ll_count does not changes and new picture does not appears in This.ole_word.Object.Appli
How I can control if signature picture exists in document?
There is no problem when I pplacing picture to main document, only with textbox.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
key phrase is "InLineShapes collection because it is in another StoryRange".
With this I have found the solution how to find signature image in the document too:
// to check if exists sign image in document marked with AlternativeText = as_var
Long ll_count, ll_count_in_shape
Long ll_i, ll_j
Boolean lb_exists
ll_count = This.ole_word.Object.Appli
FOR ll_i = 1 TO ll_count
This.ole_word.Object.Appli
ll_count_in_shape = This.ole_word.Object.Appli
FOR ll_j = 1 TO ll_count_in_shape
If This.ole_word.Object.Appli
lb_exists = true
exit
end if
NEXT
NEXT
Is it possible to do better?