Getting a Cell contents as SuggestedFileName

I add a MenuItem to save the contents of a TextArea as RTF (to display it later).

After an hour or two, I add a variable to hold the Listbox entry and set its value to the SuggestedFileName (of SaveAsDialog).

Unfortunately, this does not works (I get the French Untitled instead)). I saw the variable contents (My_Save_Name) disappearing in the debugger and I do not understand why.

(Relevant Used code:

[code] Dim Save_RTF_Dlg As New SaveAsDialog
Dim Save_RTF_FI As FolderItem
Dim My_Save_Name As String

// Get the selected text entry (Default file name)
If LB.ListIndex > -1 Then
// Take the text in the selected Row
My_Save_Name = LB.Cell(LB.ListIndex, 1)
Else
// Use a Default Name (and let the user change it !)
My_Save_Name = “Suggestion de nom.rtf”
End If

// Save_RTF_Dlg.InitialDirectory = SpecialFolder.Desktop
Save_RTF_Dlg.PromptText = “Donnez un nom et un emplacement”
Save_RTF_Dlg.SuggestedFileName = My_Save_Name
Save_RTF_Dlg.Title = “Enregistrer sous…”
Save_RTF_Dlg.Filter = TF_Text.All
Save_RTF_FI = Save_RTF_Dlg.ShowModal()
If Save_RTF_FI = Nil Then
Return False
End If[/code]

My_Save_Name exists nowhere else in that project.

Clues and ideas are welcome.

You made sure in debugger, that My_Save_Name is set with the cell text?

Yes Christian. I was able to see the variable contents disappears in the Debugger (how is this possible, I do not know).
And, this is a small Save As MenuHandler (few lines of code), so how can I do not understand the “HowTo" ?

I searched earlier today this conversation, but I do not found it.

I wanted to say at woke up time today, I got an idea: something clears my variable contents. Why don’t I set a Module Property and store the Cell String contents there ? Once I had 5 minutes, I do that and that is working fine.

I still do ot know the reason why, but who cares when you have a good workaround ?