increases for every time the page is opened. It is similar to a
visitors-counter.
When I look at the page with Internet Explorer it works just fine.
Now I want to read this web-page from a MS-Word macro and include the
number as a company wide unique id in my MS-Word document.
Unfortunately, the PHP script doesn't update the counter when I call
it from my MS-Word macro.
How can I force PHP to update my counter when I call it from a VBA
macro?
I am using the following code:
Put the following into the Declarations section of your program:
Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Put the following as a new function:
Private Function DownloadFile(URL As String, LocalFilename As String) _
As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Then finally use the following code in your main program:
result = DownloadFile("http://intranet/autoid.php", "c:/ai.txt")