[Solved] Change all Lower Case text to Upper Case in Page names with VBA

Started by SubPlanner, January 08, 2016, 04:14:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SubPlanner

What would be the code to use to change all the page names from lower case to upper case using VBA.

Any help would be appreciated.

SubPlanner

JohnGoldsmith

Hi,

You can just loop through the pages and change the names as you go:

Public Sub PagesToUpper(ByRef vDoc As Visio.Document)
If Not vDoc Is Nothing Then
    Dim vPag As Visio.Page
    For Each vPag In vDoc.Pages
        vPag.Name = UCase(vPag.Name)
        'Uncomment next line to force NameU to be the same as Name
        'vPag.NameU = vPag.Name
    Next
End If
End Sub


You can then call that code like this:

Public Sub ChangePages()
    Call PagesToUpper(ThisDocument) 'Change ThisDocument as required
End Sub


Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

SubPlanner