I have a document that I am trying to print multiple times and print out a serial number on each copy via a Macro
in the document I have the SerialNum1 in the location where the serial number should be and formatted as it should look
It was suggested that I use to replace
SerialNum1 with the current counter in the variable
sn.
Code:
.Range.FormattedText = Replace(.Range.FormattedText, "SerialNum1", Format(sn, "000"))
When I run the macro, I am getting a Compile Error: type mismatch that highlights the Replace() part of .Range.FormattedText = Replace(.Range.FormattedText, "SerialNum1", Format(sn, "000"))
However, if I use
Code:
.Range.Text = Replace(.Range.Text, "SerialNum1", Format(sn, "000"))
it works however my entire document looses all of its formating and graphics.
Is there a way to make this work without the loss of my formating?