new_php85 Posted December 9, 2015 Share Posted December 9, 2015 Hi everyone.... I have some issue... There is document which is VBA word 2010. When someone open / click the document, some information (ip address, computer detail. hash code etc..) should be consume by php. I have no idea how php can help. anyone have idea. thanks in advance... Here is some code for VBA Dim appWord As New appWord Private Sub Document_Open() Set appWord.appWord = Word.Application Set appWord.appWord = Word.Application Call FirstTime Call Show Call Test("1") Call DisableCopy Call PrepareHistory Call TrySendPastData End Sub Private Sub Document_Close() Call Test("2") Call Hide ActiveDocument.Save End Sub Private Sub Register_Event_Handler() Set appWord.appWord = Word.Application End Sub Private Sub Test(activity As String) On Error GoTo SkipTest Dim result As String Dim myURL As String, postData As String Dim winHttpReq As Object Dim sHostName As String Dim sUserName As String Dim ldap As String Dim md5 As String Dim p As String Dim rw As String rw = "" 'Cw.GetBssid sHostName = Environ$("userdomain") sUserName = SafeString(Application.UserName & "|" & Environ$("username")) Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") ldap = Inpho.GetLDAPUserName() & "|" & Inpho.GetLocalDomainUserName() md5 = Evaluate(Inpho.GetCleanName() & ldap & sHostName & sUserName) myURL = "http://localhost/test2.php" postData = "key=" & ActiveDocument.Variables("documentid") & "&a=" & activity & "&info=" & SafeString(Inpho.GetCleanName()) & "&d=" & sHostName & "&u=" & sUserName & "&i=" & SafeString(md5) & "&p=" & SafeString(Inpho.GetSerial()) & "&w=" & SafeString(rw) winHttpReq.SetTimeouts 2000, 2000, 2000, 2000 winHttpReq.Open "POST", myURL, False winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" winHttpReq.Send (postData) If winHttpReq.Status = "404" Then Call HisStory(md5, activity) Exit Sub End If SkipTest: Call AddToDataId(postData) Call HisStory(md5, activity) End Sub Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.