D
Dean Blaby
Im trying to write a macro that automatically sequentially numbers letters
written in Word as the "My reference " subject line
I have inserted a bookmark called "Order" and then tried to insert a Macro
into the document which I found here:
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm
Sub AutoNew()
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
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "00#")
ActiveDocument.SaveAs FileName:="path" & Format(Order, "00#")
End Sub
However the lines "Order = System etc and System.PrivetProfile are
highlighted in red and return a syntax error when compiling.
Im really stumped
Can anyone help me do this simple task?
Please email (e-mail address removed) with anyhelp you can provide.
TIA
Dean
PS Using MacOS 10.3.5 and Office v.X
written in Word as the "My reference " subject line
I have inserted a bookmark called "Order" and then tried to insert a Macro
into the document which I found here:
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm
Sub AutoNew()
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
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "00#")
ActiveDocument.SaveAs FileName:="path" & Format(Order, "00#")
End Sub
However the lines "Order = System etc and System.PrivetProfile are
highlighted in red and return a syntax error when compiling.
Im really stumped
Can anyone help me do this simple task?
Please email (e-mail address removed) with anyhelp you can provide.
TIA
Dean
PS Using MacOS 10.3.5 and Office v.X