vb.net - How to find and replace text in the Visio file by .Net programming -


i need create lot of flowchart use templates below. enter image description here

each flowchart changes "table_name" label.

finally, each flowchart exported image(.png)

private sub createflowchartvisio(byval templatefilename string, byval saveas object)    dim vapp visio.application    dim vdoc visio.document           vapp = new visio.application()            vdoc = vapp.documents.openex(templatefilename, 4)    ''///code replace table_name likes below code''//    vdoc.content.find.execute(findtext:="*table_name*", replacewith:=screentitle & " master", replace:=word.wdreplace.wdreplaceall)     each p visio.page in vdoc.pages        dim n string = saveas        p.export(n)    next    vdoc.close() end sub 

i tried use replace function in word application

vdoc.content.find.execute(findtext:="*table_name*", replacewith:=screentitle & " master", replace:=word.wdreplace.wdreplaceall) 

but isn't working.

i tried use replace function in word application

    vdoc.content.find.execute(findtext:="*table_name*", replacewith:=screentitle & " master", replace:=word.wdreplace.wdreplaceall)    

but isn't working.

no doubt, because each shape have own text property. must iterate shapes on page. , iterate pages in document
, ms word's method dont works in ms visio. vba macro task

dim p page dim shp shape each p in vdoc.pages   each shp in p.shapes    shp.characters.text = replace(shp.characters.text, "table_name", screentitle & " master") next shp p.export(n) next p 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -