mcinvalek
11-22-2016, 09:52 PM
I want to track a user of a powerpoint 2013 (x86) deck that I have created. Oh, im new to VBA programming and so my code is not very sophisticated. So far, I have created a mechanism that will write out to file: username, time, slide number. I need to have this running and "If I <> 1 Then ..." Or should I wrap the whole thing in a for each. I want this code to run all of the time and also append the data each time a person clicks on a different slide. One last print on close of the ppt file would be great too. Any suggestions would be most appreciated.
Sub Prnt()
Dim i As Integer, istring As String
i = ActiveWindow.Selection.SlideRange.SlideIndex
istring = Str(i)
Open "TESTFILE.txt" For Output As #1 ' Open file for output.
Write #1, Environ("username") & "," & Format(Now, "MM/dd/yyyy h:mm:ss") & "," & istring
'If i <> 1 Then Exit Sub
End Sub
Sub Prnt()
Dim i As Integer, istring As String
i = ActiveWindow.Selection.SlideRange.SlideIndex
istring = Str(i)
Open "TESTFILE.txt" For Output As #1 ' Open file for output.
Write #1, Environ("username") & "," & Format(Now, "MM/dd/yyyy h:mm:ss") & "," & istring
'If i <> 1 Then Exit Sub
End Sub