how to Untranslated an image from a macro ?

Hi,

 I try by macro to untranslated an image in passolo 2018 18.0.178.0

The image comes from a .CHM file. My first image it's the Resource(6).

I can provide the lpu if you need.

When I try to change the value for the state of pslStateTranslated

The debugger stop and  I received the error on execution 

128) This state flag can not be set for this resource. 

On this line

prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)= False

 

Set prj = PSL.ActiveProject 

If (prj.TransLists.Item(1).Resource(6).IsBinary )then

     If (prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)) Then   

          ‘ import the source image in the translated list        

          filename = prj.TransLists.Item(1).SourceList.Resource(6).IDName       

          target2 = prj.TransLists.Item(1).SourceList.Resource(6).ExportBinary("D:\test",fileName)       

          prj.TransLists.Item(1).Resource(6).ImportBinary(target2)     

           ‘ try to set the image to untranslated. 

          prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)= False       

          prj.TransLists.Item(1).Save 

     end if

end if

 

If this is the right way to untranslated an image?

emoji