Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all
I have a little problem.
I am trying to wirte in a text object via macro the "last modified date" of one file
Despite all my effort I was not able to do it. I add below the code I used
Is it possible to do the above task directly in the script so as to have the above when I do the Reload
Thanks in advance for your help
Carlo Pazzaglia
Sub MyInfo
Dim FilePath,MyObjectFile
FilePath= "C:\Documents and Settings\KAICPA2\Desktop\My.qvd"
Set fso = CreateObject("Scripting.FileSystemObject")
set MyObjectFile= fso.GetFile (FilePath)
ActiveDocument.GetSheetObject( "TX08" ).GetText = MyObjectFile.DateLastModified
end sub
Hello Carlo
This won't work because you're trying to use GetText method to set text, try something like the following to replace your last line:
Set MyText = ActiveDocument.GetSheetObject("TX08")
prop = MyText.GetProperties
prop.Layout.Text.v = MyObjectFile.DateLastMadified
MyText.SetProperties prop
Note: I haven't tested this, but it should work!
Good luck,
Hello Carlo
This won't work because you're trying to use GetText method to set text, try something like the following to replace your last line:
Set MyText = ActiveDocument.GetSheetObject("TX08")
prop = MyText.GetProperties
prop.Layout.Text.v = MyObjectFile.DateLastMadified
MyText.SetProperties prop
Note: I haven't tested this, but it should work!
Good luck,
It works fine!!!
Thanks a lot for the precious help!!! I could not get it by myself.....
Carlo
How about setting a variable in the script using QV functions instead?
LET vFiletime = FileTime('C:\Documents and Settings\KAICPA2\Desktop\My.qvd');
or
LET vFiletime = QvdCreateTime('C:\Documents and Settings\KAICPA2\Desktop\My.qvd');
And then in your TextBox:
=$(vFiletime)
-Rob
Thanks a lot
This is the second piece of information I was looking for!
Now with both solution I am able to choose from case to case.
Thanks one more to all of you
Carlo