On Aug 27, 2006, at 7:05 AM, Robert Poland wrote:
But...Neither "MainWindow.Title = [String]" nor "FolderItem.Name =
[String]" worked for me, "This method or property does not exist".
MainWindow is the name of your window and FolderItem is the variable
name you used to create your folderitem.
Assuming you have used the default Window1, it would be Window1.Title
or Self.Title depending on where the code is.
If you are saving a new file, you need a folderitem. You would simply
use that to assign the name.
Dim f As New Folderitem
f.name= [your new title string with date]
If you are opening a previously saved file, you probably wouldn't
want to change the date until it is saved. This will do that for you:
Note: f should be a property of the window so it doesn't go out of
scope until the window closes.
Opening:
Window1.Title=f.name
Saving:
Dim MyName As String // This could also be a property of the window
Dim d As New Date
Dim Today As String
Today =" "+Format(d.Month,"00") +"-"+Format(d.Day,"00")+"-"+Right
(Str(d.Year),2)
MyName=f.Name
MyName= Left(MyName,len(MyName)-9)+Today
When you save the file, you will create a new file as the folderitem
name will be different. If you wished to replace the old file you
would delete it first.
f.delete
then change f's name
f.name = NewName
then save the file.
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>