We help IT Professionals succeed at work.

Run macro on opening dot-file

Andreas Hermle
Andreas Hermle used Ask the Experts™
on
Dear Experts:

I got a dot-file (97-2003) - named 'MyManual.dot' which - when get opened - (i.e. a document derived from that dot-file) should be subjected to the following action:

Select the whole text, go to the Paragraph - Indents and Spacing - Outline Level and apply the Textbody Level to the whole selection and then deselect.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
When you create a new document from a dot file the new document will look exactly like the dot file... so you could just manually do it once (in the dot file)...?

I suspect you have lots of documents that you wish to fix?
Commented:
Otherwise, I think what you are looking for is something like

Sub AutoNew()

    Selection.WholeStory
    Selection.ClearFormatting
    Selection.Style = ActiveDocument.Styles("Normal")
    Selection.MoveLeft Unit:=wdCharacter, Count:=1

End Sub 

Open in new window

Andreas HermleTeam leader

Author

Commented:
Okay, that did the trick. Thank you very much for you professional help.

Regards, Andreas

Commented:
thanks :-)