Jump to content

VBA to php


new_php85

Recommended Posts

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)
    
    
    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 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.