Skip to content

Commit

Permalink
フォルダツリー作成で、ファイル名に「#」があるとハイパーリンクが動作しない #72
Browse files Browse the repository at this point in the history
  • Loading branch information
RelaxTools committed Mar 6, 2021
1 parent 5633b44 commit 3e3727f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Binary file modified RelaxTools.xlam
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/src/Form/frmTreeList.frm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Private Sub cmdRun_Click()
If chkFolder.Value Then
ActiveSheet.Hyperlinks.Add _
Anchor:=Cells(lngRow, lngCol), _
Address:=strPath, _
Address:=FileToURL(strPath), _
TextToDisplay:=strPath
End If

Expand Down Expand Up @@ -234,7 +234,7 @@ Private Sub FileDisp(objFs, ByVal strPath, lngRow, ByVal lngCol, ByVal lngHCol A
If chkFile.Value Then
ActiveSheet.Hyperlinks.Add _
Anchor:=Cells(lngRow, lngCol2), _
Address:=rlxAddFileSeparator(strPath) & colFiles.Item(objKey).Name, _
Address:=FileToURL(rlxAddFileSeparator(strPath) & colFiles.Item(objKey).Name), _
TextToDisplay:=colFiles.Item(objKey).Name
End If

Expand Down Expand Up @@ -298,7 +298,7 @@ Private Sub FileDisp(objFs, ByVal strPath, lngRow, ByVal lngCol, ByVal lngHCol A
If chkFolder.Value Then
ActiveSheet.Hyperlinks.Add _
Anchor:=Cells(lngRow, lngCol2), _
Address:=colFolders.Item(objKey).Path, _
Address:=FileToURL(colFolders.Item(objKey).Path), _
TextToDisplay:=rlxGetFullpathFromFileName(colFolders.Item(objKey).Path)
End If

Expand Down
5 changes: 5 additions & 0 deletions Source/src/Modules/basCommon.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3015,3 +3015,8 @@ Function SpecialCellsEx(v As Range) As Range
Set SpecialCellsEx = r

End Function
Function FileToURL(ByVal arg As String) As String

FileToURL = "file:///" & Replace(arg, "#", "%23")

End Function
1 change: 1 addition & 0 deletions Version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
◇バグ修正
・VBAステップカウントの誤字を修正。
・結合セルの高さ拡張の誤字 #71
・フォルダツリー作成で、ファイル名に「#」があるとハイパーリンクが動作しない #72

2020/12/27(sun) RelaxTools-Addin Version 4.27.2(RustRemover)
◇バグ修正
Expand Down

0 comments on commit 3e3727f

Please sign in to comment.