vba - how to know if a shape parameter exist -


i want see if video linked or not using vba. check parameters of shape , saw video linked linkformat parameter enable , if not disabled. problem if check linkformat when not linked video error "object not exist". want check if exist or not without having error.

i try put error handler anyway giving me error.

edit: here put how trying make advices receive in post:

   each sld in activepresentation.slides      = 1 sld.shapes.count         if sld.shapes(i).type = msomedia                  if hasvideo = false                     hasvideo = true                 end if                 videonum = videonum + 1                       if sld.shapes(i).mediatype = ppmediatypemovie                         if csng(application.version) < 14                             if hasvideo = false                                 hasvideo = true                             end if                             videonum = videonum + 1                         else                             if sld.shapes(i).mediaformat.isembedded                                 if hasvideo = false                                     hasvideo = true                                 end if                                 videonum = videonum + 1                             else                                 msgbox "linked videos not supported , won't shown"                                                             end if                         end if                   end if         end if      next    next 

sub testvideos()     ' osh object rather shape it'll work     ' in earlier versions of ppt don't have of these     ' properties     dim osh object     dim osl slide      ' because test file has 2 videos     ' on slide 1 ...     set osl = activepresentation.slides(1)      each osh in osl.shapes         if osh.type = msomedia             if osh.mediatype = ppmediatypemovie                 if csng(application.version) < 12                     ' ppt 2003 or earlier; vids embedded                     msgbox "this video embedded"                 else                     if osh.mediaformat.isembedded                         msgbox "this video embedded"                     else                         msgbox "this video linked"                     end if                 end if             end if         end if     next  end sub 

Comments