T
Tracy
hello
I am trying to create a one page document template that
each time it is used reflects a sequential number e.g 001..
I tried using the copy and pasting this macro I found on
this site(see below) and got the following error: runtime
error -2147467259 (80004005)method private profile string
of object'system failed' (no VB experience )
Sub AutoNew()
Order = System.PrivateProfileString
("C:\DocumentsandSettings\tracy12.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
I am trying to create a one page document template that
each time it is used reflects a sequential number e.g 001..
I tried using the copy and pasting this macro I found on
this site(see below) and got the following error: runtime
error -2147467259 (80004005)method private profile string
of object'system failed' (no VB experience )
Sub AutoNew()
Order = System.PrivateProfileString
("C:\DocumentsandSettings\tracy12.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