Übergeben Sie die Zeichenfolge an der Visio -Formdatentabelle mit PythonPython

Python-Programme
Anonymous
 Übergeben Sie die Zeichenfolge an der Visio -Formdatentabelle mit Python

Post by Anonymous »

Ich versuche, den String -Wert an die datentabelle der Visio -Form zu übergeben, aber ich kann den Zahlenwert an die Visio -Formtabelle übergeben und wenn der Pass -String -Wert Python Fehler wirft. < /p>
Bitte bitte Hilf mir, was ich fehlt, was ich getan habe.

Code: Select all

import win32com.client

appVisio = win32com.client.Dispatch("Visio.Application")
appVisio.Visible =1

doc = appVisio.Documents.Add(r'C:\Users\anas\Visio\Input\Template.vsdx')
pagObj = doc.Pages.Item(1)
stnObj = appVisio.Documents("Oneweb.vssx")
mastObj = stnObj.Masters("NDC")

shpObj1 = pagObj.Drop(mastObj, 4.25, 5.5)
shpObj1.Text = "This is some text."
# set the cell
shpObj1.CellsU("Prop.SiteName").FormulaU = "=2.5" // successfully running

shpObj2 = pagObj.Drop(mastObj, 2, 2)
shpObj2.Text = "This is some more text."
shpObj2.CellsU("Prop.SiteName").FormulaU = "Test" // getting error in this line

connectorMaster = appVisio.Application.ConnectorToolDataObject

connector = pagObj.Drop(connectorMaster, 0, 0)
connector.Cells("BeginX").GlueTo(shpObj1.Cells("PinX"))
connector.Cells("EndX").GlueTo(shpObj2.Cells("PinX"))

doc.SaveAs(r'C:\Users\anas\Visio\Output\MyDrawing.vsd')
doc.Close()

appVisio.Visible =0

appVisio.Quit()

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post