0 Replies Latest reply: Apr 26, 2017 9:56 AM by Alexandre Depouez RSS

    Move object dynamically

    Alexandre Depouez

      Hello,

       

      I'm trying to create an extension which change the position of objects, depend on variables.

       

      I have created a macro to do that.

      But macro doens't works on webview.

       

      Now, I trying to transforme my macro into an extension.

       

      Is anybody can help me to do that?

       

      Below my macro:

      SUB Position()
        TopSCCTitle = 70
        TopSCCMenu = 95
        LeftPos = 800
      
        if ActiveDocument.Variables("vDisplayMenuSCC").GetContent.String="1" then
          TopFamilleTitle = TopSCCMenu + 125
          TopFamilleMenu  = TopFamilleTitle + 25
        ELSE
          TopFamilleTitle = TopSCCTitle + 25
          TopFamilleMenu  = TopFamilleTitle + 25
        END IF
      
        '//LABELMenu_SCC
        set obj = ActiveDocument.GetSheetObject("LABELMenu_SCC") 
        pos = obj.GetRect
        pos.Top =  TopSCCTitle
        pos.Left = LeftPos
        obj.SetRect pos
        '//Menu_SCC
        set obj = ActiveDocument.GetSheetObject("Menu_SCC") 
        pos = obj.GetRect
        pos.Top = TopSCCMenu
        pos.Left = LeftPos
        obj.SetRect pos
      
        '//LABELMenu_Famille
        set obj = ActiveDocument.GetSheetObject("LABELMenu_Famille") 
        pos = obj.GetRect
        pos.Top = TopFamilleTitle
        pos.Left = LeftPos
        obj.SetRect pos
        '//Menu_SCC
        set obj = ActiveDocument.GetSheetObject("Menu_Famille") 
        pos = obj.GetRect
        pos.Top =  TopFamilleMenu
        pos.Left = LeftPos
        obj.SetRect pos
      
      END SUB
      

       

      Thank you

       

      Regards,

       

      Alex