Changing text in description column of a HoleTable

Changing text in description column of a HoleTable

rossano_praderi
Collaborator Collaborator
872 Views
2 Replies
Message 1 of 3

Changing text in description column of a HoleTable

rossano_praderi
Collaborator
Collaborator

Hi, i'm trying to change the value in the description column through the formattedtext but the final result is not what is supposed to be, this is a part of my code.

 

Sub HoleTab()
Set oDrwDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim i As Integer
Set oSheet = oDrwDoc.ActiveSheet
Dim oHoleTables As HoleTables
Set oHoleTables = oSheet.HoleTables
Dim oTable As HoleTable
Dim oTableRow As HoleTableRow
Dim oTableRows As HoleTableRows
Dim MProfondità As String
MProfondità = "<StyleOverride Font='AIGDT' FontSize='0.35'>n</StyleOverride><StyleOverride Font='Tahoma' FontSize='0.35'><HoleProperty HolePropertyID=&apos;77581&apos; Precision=&apos;2&apos;></HoleProperty> -<HoleProperty HolePropertyID=&apos;77580&apos; Precision=&apos;2&apos;></HoleProperty> PROFONDITÀ</StyleOverride><Br/><StyleOverride Font='Tahoma' FontSize='0.35'>VEDI MASCHERA</StyleOverride>"
For Each oTable In oHoleTables
    For i = 1 To oTable.HoleTableRows.Count
        If Len(oTable.HoleTableRows.Item(i).Item(1).Text) >= 5 Then
                    oTable.HoleTableRows.Item(i).Item(4).FormattedText = MProfondità
        End If
    Next
Next
End Sub

 Before

Before.png

 

After

After.png

 

Can anyone help me, please.

 

Thank you in advance

 



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes
Accepted solutions (2)
873 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Correct the XML tag as below 

 

MProfondità = "<StyleOverride Font='AIGDT' FontSize='0.35'>n</StyleOverride><StyleOverride Font='Tahoma' FontSize='0.35'><HoleProperty HolePropertyID='77581' Precision='2'></HoleProperty> -<HoleProperty HolePropertyID='77580' Precision='2'></HoleProperty> PROFONDITÀ</StyleOverride><Br/><StyleOverride Font='Tahoma' FontSize='0.35'>VEDI MASCHERA</StyleOverride>"

 

Hope this will work.

Message 3 of 3

rossano_praderi
Collaborator
Collaborator
Accepted solution

Thank you so much for your help!

 

I've modified my code with your suggestion and now my code is started to give me an other error, then I've correct the "FontSize='0.35'" Tag in "FontSize='0,35'" and it start to work fine.

 

Thank you 



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes