> Great information. I'll be modifying my code to use stored AutoText
> entries.
>
> I think on the last question, you missed that I am not Lee (the
> original questioner). In my case I don't have an undo stack to rely
> on. So, to pose the question again:
>
> From my investigations, I haven't been able to uniquely identify a
> watermark object. Watermarks appear to be in the header/footer, to be
> WordArt, and to be part of the Shapes collection. Unfortunately so
> are some of the logos and tag lines that are in the documents. Do you
> know how to be sure what you're about to delete is a watermark? (The
> documents may have pre-existing watermarks so I don't know the item
> name or the text that may be encountered.) For the watermarks I
> create, I can name them for easy selection and deletion.
>
> "Jay Freedman" wrote:
>
>> In line...
>>
>> Neil Humphries wrote:
>>> Jay, can you expand on "a template, and not a document acting as a
>>> phony template...". What are the differences and implications of
>>> using one or the other?
>>
>> Well, a lot of people never use templates other than the Normal.dot
>> (or Normal.dotm in Word 2007) that's the base for "new blank
>> documents". When they need a new document that's similar to an old
>> document, they just open the old document and use Save As to make a
>> copy that they then modify. That's what I meant by "a document
>> acting as a phony template".
>>
>> A real template, with a filename extension of .dot (in 2007, .dotx or
>> ..dotm), has a few characteristics that aren't shared by documents.
>> One of those is that AutoText entries can't be stored in documents,
>> only in templates.
>>
>> In 2003 and earlier, the default location for AutoText was
>> Normal.dot. In 2007, the default is Building Blocks.dotx. In either
>> case, by changing a setting in the dialog when you create the entry,
>> you can direct it to a different template. If these watermarks are
>> going to be used only in documents based on one template, they
>> should be stored in that template; if they're needed more generally,
>> they should be in the default location (in your case, Building
>> Blocks.dotx).
>>
>>> I am using Word 2007 and would appreciate a 2007 version.
>>
>> I'll get back to you shortly -- after I've had a chance to write the
>> macro and test that I got it right.
>>
>>> I suspect the gnarly part is resizing the watermark text to suit.
>>> Copying the watermark from a template would let Word handle all the
>>> rotation and resizing, correct?
>>
>> No, the idea is that you create, size, and otherwise format the
>> watermark only once, and store the result. That can be reused ad
>> infinitum with no further manipulation.
>>
>>> Is it possible to create a series of watermark autotext entries all
>>> stored in the same template? e.g. Draft, Not For Tender, For
>>> Coordination, Copy. I could then let the user pick from a list box.
>>
>> Yes, all you need to do is give each entry a unique name.
>>
>>> From my investigations, I haven't been able to uniquely identify a
>>> watermark object. Watermarks appear to be in the header/footer, to
>>> be WordArt, and to be part of the Shapes collection. Unfortunately
>>> so are some of the logos and tag lines that are in the documents.
>>> Do you know how to be sure what you're about to delete is a
>>> watermark? (The documents may have pre-existing watermarks so I
>>> don't know the item name or the text that may be encountered.) For
>>> the watermarks I create, I can name them for easy selection and
>>> deletion.
>>
>> The scheme you outlined before was that the watermark is present in
>> the document only as long as it takes to print. That's why the macro
>> I showed contains ".Undo" near the end -- the effect of that
>> statement is to remove the AutoText entry that was added at the
>> beginning of the macro, just as if you had clicked the Undo button.
>> The watermark object in the document doesn't have to be named or
>> tagged in order to remove it. There's also no confusion between the
>> watermark and any pre-existing logo or other things in the document;
>> the "undo stack" knows what item was added last and how to remove it.
>>
>> The one possible concern, which you would have to test on your
>> documents, is whether the watermark causes the logo to be pushed to
>> an incorrect position. If so, you'll have to format the watermark
>> (and possibly also the logo) to allow overlap.
>>
>>> "Jay Freedman" wrote:
>>>
>>>> On Thu, 20 Nov 2008 13:49:01 -0800, Lee Kiwiflame
>>>> <LeeKiwiflame[ at ]discussions.microsoft.com> wrote:
>>>>
>>>>> When a user presses a "Reprint" button, I want some code that:
>>>>>
>>>>> - inserts a "Copy" watermark
>>>>> - shows the print dialogue box so the user can select a printer
>>>>> - then delete the watermark once the document has been printed.
>>>>>
>>>>> Can anybody help me with some code for this? I'm not even sure
>>>>> where to start. I did try recording the macro but I'm now stuck.
>>>>>
>>>>> Thanks
>>>>
>>>> Don't try to create the watermark in code. It's gnarly and ugly,
>>>> not to mention
>>>> slow. Instead, do this (note these instructions are for Word 2003
>>>> or earlier; if
>>>> you need them for Word 2007, post back):
>>>>
>>>> - Open the template you're creating for this specific kind of
>>>> document. (You _are_ making a template, and not a document acting
>>>> as a phony template, I hope...)
>>>>
>>>> - Use the watermark dialog to insert a COPY watermark. (No macro
>>>> yet.)
>>>>
>>>> - Open the header pane and select the watermark.
>>>>
>>>> - Go to Insert > AutoText > AutoText. Enter the name CopyWatermark.
>>>> Click the Look In box and make sure it's set to your template,
>>>> not Normal.dot or "All active templates". Click the Add button
>>>> and
>>>> then OK.
>>>>
>>>> - Back in the document, delete the watermark.
>>>>
>>>> - Open the VBA editor and paste in this code:
>>>>
>>>> Sub Reprint()
>>>> Dim oRg As Range
>>>> With ActiveDocument
>>>> Set oRg = .Sections(1).Headers(wdHeaderFooterPrimary).Range
>>>> .AttachedTemplate.AutoTextEntries("CopyWatermark").Insert _
>>>> Where:=oRg, RichText:=True
>>>> Dialogs(wdDialogFilePrint).Show
>>>> .Undo
>>>> End With
>>>> End Sub
>>>>
>>>> - Create a Reprint button assigned to the Reprint macro.
>>>>
>>>> --
>>>> Regards,
>>>> Jay Freedman
>>>> Microsoft Word MVP FAQ:
http://word.mvps.org>>>> Email cannot be acknowledged; please post all follow-ups to the
>>>> newsgroup so all may benefit.