I would leaveWordout of the equation and just run the code fromVisio.
How are you doing the translation?
One thing to note is thatVisioshapes can contain shape collections. So
even though there is only one text block per shape, a shape can contain a
collection of shape each of which can contain a text block.
Public Sub Display_Text()
Dim PagObj AsVisio.Page
Dim shpObj AsVisio.Shape
For Each PagObj In ActiveDocument.Pages
For Each shpObj In PagObj.Shapes
process_shp shpObj
Next
Next PagObj
End Sub
Public Sub process_shp(shp AsVisio.Shape)
Dim subShp AsVisio.Shape
Debug.Print shp.Name; " "; shp.Text; " "; shp.Shapes.Count
If shp.Shapes.Count > 0 Then
For Each subShp In shp.Shapes
process_shp subShp
Next subShp
End If
End Sub
John....- Tekst uit oorspronkelijk bericht niet weergeven -
- Tekst uit oorspronkelijk bericht weergeven -
John,
Running the code from Visio is not an option to me, because the Visio
drawings are contained in a Word document. In fact, I have already a
Visio program to do my translations on a Visio drawing (file), but I
need to it for a Word doucment with embedded Visio drawings.
If there is a possibility to access these from Visio, that would be
great, but I'm afraid that's even more complex.
Do you have any suggestions?
Ruud.
I have not tried it, but it may be possible to do it to a Visio drawing
within Word.
If you are using Word, you can control Visio through Word's VBA, but you
have to include a reference to the Visio object model in the Word VBA
environment and make sure you fully qualify references so you do not confuse
VBA. (Both Visio and Word have Shapes).
John...