C
Cottage6
I have a document that includes a table with 4 rows in it, each containing a
gift certificate. Each certificate needs to be numbered, which the code
below does without a problem. However, since (for example) only 2
certificates may be requested, is there a way to use an input box (or
something) to request just those 2 certificates and not number the other 2?
The next time certificates were requested the auto number should take up
where it left off. Any help would be greatly appreciated , as I'm pretty
lost on this one. TIA
Sub AutoNew()
Order = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "0000#")
'***********************************************************************
Order2 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order2 = "" Then
Order2 = 1
Else
Order2 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order2") = Order2
ActiveDocument.Bookmarks("Order2").Range.InsertBefore Format(Order2, "0000#")
'********************************************************************************
Order3 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order3 = "" Then
Order3 = 1
Else
Order3 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order3") = Order3
ActiveDocument.Bookmarks("Order3").Range.InsertBefore Format(Order3, "0000#")
'***********************************************************************************
Order4 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order4 = "" Then
Order4 = 1
Else
Order4 = Order3 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order4") = Order4
ActiveDocument.Bookmarks("Order4").Range.InsertBefore Format(Order4, "0000#")
ActiveDocument.SaveAs FileName:="Meal Tickets" & Format(Order4, "0000#")
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order4
End Sub
gift certificate. Each certificate needs to be numbered, which the code
below does without a problem. However, since (for example) only 2
certificates may be requested, is there a way to use an input box (or
something) to request just those 2 certificates and not number the other 2?
The next time certificates were requested the auto number should take up
where it left off. Any help would be greatly appreciated , as I'm pretty
lost on this one. TIA
Sub AutoNew()
Order = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "0000#")
'***********************************************************************
Order2 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order2 = "" Then
Order2 = 1
Else
Order2 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order2") = Order2
ActiveDocument.Bookmarks("Order2").Range.InsertBefore Format(Order2, "0000#")
'********************************************************************************
Order3 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order3 = "" Then
Order3 = 1
Else
Order3 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order3") = Order3
ActiveDocument.Bookmarks("Order3").Range.InsertBefore Format(Order3, "0000#")
'***********************************************************************************
Order4 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order4 = "" Then
Order4 = 1
Else
Order4 = Order3 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order4") = Order4
ActiveDocument.Bookmarks("Order4").Range.InsertBefore Format(Order4, "0000#")
ActiveDocument.SaveAs FileName:="Meal Tickets" & Format(Order4, "0000#")
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order4
End Sub