Created
May 15, 2017 16:06
-
-
Save ooltcloud/448cfb1fb8b378c904e25c273aaa0626 to your computer and use it in GitHub Desktop.
Visio のアクティブドキュメントの全角英数を半角にする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub アクティブドキュメントの全角英数を半角にする() | |
Dim vsoPage As Visio.Page | |
Dim vsoShape As Visio.Shape | |
Dim vsoChar As Visio.Characters | |
Dim c As Integer | |
For Each vsoPage In Application.ActiveDocument.Pages | |
For Each vsoShape In vsoPage.Shapes | |
Set vsoChar = vsoShape.Characters | |
For i = 1 To vsoChar.CharCount | |
vsoChar.Begin = i - 1 | |
vsoChar.End = i | |
c = AscW(vsoChar.Text) | |
If (&HFF01 <= c And c <= &HFF5E) Then ' 全角形の範囲 | |
vsoChar.Text = StrConv(vsoChar.Text, vbNarrow) '半角変換 | |
End If | |
Next | |
Next | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment