I have a macro that inserts a draft stamp in my first page header. However, I would like to convert this to a Text Box. I’ve searched in this forum as well as across the web to see if I could figure out how to insert a text box, format it, and insert the appropriate text. I’ve located some snippets, but now I’m confused (lost). Maybe somebody has done something like this already and can point me in the right direction?
So far, I’ve come up with this:
Set Box = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=400, Top:=30, Width:=200, Height:=100)
Box.TextFrame.TextRange.Font.Name = “Calibri”
Box.TextFrame.TextRange.Font.Size = 14
Box.TextFrame.TextRange.Font.Bold = Yes
Box.TextFrame.TextRange.Text = DraftWord + DraftNum + ” ”
Box.TextFrame.TextRange.InsertSymbol CharacterNumber:=8212, Unicode:=True
Box.TextFrame.TextRange.InsertDateTime DateTimeFormat:=”MM/dd/yyyy”, InsertAsField:=False
I have code that works before the above code to ask if this is a blacklined draft or not and the draft number (which appear in the 7th line). The macro works up to this point. However, I want the text to be formatting like this:
Wells Fargo Draft #1 — 2014-11-24
FOR DISCUSSION PURPOSES ONLY
The double-hyphen in the above is supposed to be an en dash but I wasn’t sure how to insert that here. The font sizes would be different each line as well. The problem with my macro code is that after it inserts Draft Word etc. and I try to insert more, it just ovewrites what’s in the box already. Any thoughts on this?
I’ve poked around to find out how to modify position & line color, but have struck out on that. Any suggestions?
Last, I would like the macro to be able to find an existing textbox, delete it, then insert the new one. How do I name a TextBox so that I can select the same one each time? I tried bookmarks, but that didn’t seem to work. It only worked with the text in the TextBox.
Thanks!!
-Rich