What is a simple VBA code to count the number of times a word document is opened. And how do you post this number in your document.
Some clear code as I can get this to work using excel
but I can't seem to get the code right in word 2007.
A few lines of clear code for a newbe like myself would be greatly appreciated.
This is what I have. I can't get it to work so far.
Some clear code as I can get this to work using excel
but I can't seem to get the code right in word 2007.
A few lines of clear code for a newbe like myself would be greatly appreciated.
This is what I have. I can't get it to work so far.
Code:
Sub AutoOpen()
Order = System.PrivateProfileString("C:\Settings.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("C:\Settings.txt", "MacroSettings", _
"Order") = Order
End Sub
Comment