I have an array of images where I upload charts.
If I upload a chart, the title of that chart is automatically
written in a list in Multiline Text1.
My question is: If I replace a chart in an image of the array,
how can I replace the corresponding name in Text1?
In the same position.
Thanks
Here is my code that works (almost perfectly). The only problem is that it writes the name
of the replaced graph twice. How can I improve the problem?
'===================
Dim Slash As String
On Error Resume Next
If Right(App.Path, 1) <> "\" Then Slash = "\"
CommonDialog1.InitDir = App.Path & Slash & "Graphics"
CommonDialog1.FileName = App.Path & Slash & "Graphics" & "\*.*"
CommonDialog1.ShowOpen
Image1(Index).Picture = LoadPicture(CommonDialog1.FileName)
Dim a As String
a = CommonDialog1.FileTitle
Text1.Text = Text1.Text & Left$(a, Len(a) - 4) & vbCrLf ' Write graphic name in Text1 Multiline
Dim fileNames() as String
fileNames = Split(Text1.Text, vbCRLF)
Text1.Text = Replace(Text1.Text, fileNames(index), Left$(a, Len(a) - 4))
If I upload a chart, the title of that chart is automatically
written in a list in Multiline Text1.
My question is: If I replace a chart in an image of the array,
how can I replace the corresponding name in Text1?
In the same position.
Thanks
Here is my code that works (almost perfectly). The only problem is that it writes the name
of the replaced graph twice. How can I improve the problem?
'===================
Dim Slash As String
On Error Resume Next
If Right(App.Path, 1) <> "\" Then Slash = "\"
CommonDialog1.InitDir = App.Path & Slash & "Graphics"
CommonDialog1.FileName = App.Path & Slash & "Graphics" & "\*.*"
CommonDialog1.ShowOpen
Image1(Index).Picture = LoadPicture(CommonDialog1.FileName)
Dim a As String
a = CommonDialog1.FileTitle
Text1.Text = Text1.Text & Left$(a, Len(a) - 4) & vbCrLf ' Write graphic name in Text1 Multiline
Dim fileNames() as String
fileNames = Split(Text1.Text, vbCRLF)
Text1.Text = Replace(Text1.Text, fileNames(index), Left$(a, Len(a) - 4))