How to change visio shape size using pthon package win32com

建峰 蔡 1 Reputation point

I connect with visio using python package win32com and get shape, but I don't konw how to change its size
import win32com.client as win32

    appVisio = win32.gencache.EnsureDispatch("Visio.Application")  
    vdoc = appVisio.Documents.Add("FAULT_M.VSTX")  
    stn = appVisio.Documents.Open("FAULT_M.VSSX")  
    page = vdoc.Pages.Item(1)  
    masters = stn.Masters  
    master = masters.ItemU("Event")  
    shp1 = page.Drop(master, 6, 8)   
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,745 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 23,906 Reputation points Microsoft Vendor

    Try this:

    from win32com.client import constants  
    shp1.Resize(constants.visResizeDirW,100, constants.visMillimeters)