PDA

View Full Version : AUTOCAD VBA: USER WHO LAST SAVED A DWG



mhenderson
08-28-2008, 05:32 PM
I have the following Code:


sFolderToLookIn = "W:\00Projects\" & ComboBox1.Text & "\" & TextBox4.Text & "\Drawings"
sFileToLookAt = ListBox1.list(I)
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace(sFolderToLookIn) ' Read only and last saved by
For Each sFileName In oFolder.Items
If sFileName = sFileToLookAt Then
For I = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(I) = True Then
filepath = "W:\00Projects\" & ComboBox1.Text & "\" & TextBox4.Text & "\Drawings\" & ListBox1.list(I)
vdate = FileDateTime("W:\00Projects\" & ComboBox1.Text & "\" & TextBox4.Text & "\Drawings\" & ListBox1.list(I))
User = Replace(oFolder.GetDetailsOf(sFileName, 8), "CONTECH\", "")
Label11.Caption = "Last Modified on: " & vdate & " by " & User
End If
Next
End If
Next


My form is pretty simple. I have list box with all the drawings in a given folder. The user can highlite and open the drawing that he wants to open. When the user highlites the DWG, the LAST MODIFIED date and time displays as well as the USER....however, with the code above....if a new user gets in and edits the DWG, the LAST MODIFIED date updates, but the USER is still the creator of the DWG.

Can I return the user who just opened, and saved the DWG?

P.S. saying LAST SAVED instead of LAST MODIFIED returns the same results.

kimballls
10-23-2008, 02:24 PM
I am new to this site and quite honestly I do not know where to begin or even if I am on the right forum.
I used to have a computer running Windows 98 SE and I became quite proficient using the drawing program Actrix Technical. I would like to continue using this program and be able to access drawings I have saved.
I now have a new computer running Windows XP Pro and also a laptop running the same operating system. I have tried to load Actrix Technical on both computers but during the installation I get a message saying "VBA FAILED". I continued with the installation but the program would not run.
I assume that is because I am now using Windows XP.
Can anyone suggest how I can overcome this problem?
Many thanks in anticipation.:(