Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Save changes to Document 1?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patricia D - 31 May 2006 01:06 GMT
Help - I can't get rid of this question.  Using an AutoExec module, there is
a subroutine to ensure that the Normal style has correct font and font size
as per our company standards.
However, this gives rise to the 'Save changes to Document 1?' question on
exit from Word - even when changes are not made.  The
"ActiveDocument.AttachedTemplate.Saved = True" code was my attempt to get rid
of the pesky message!

Sub SetNormalStyle()
   If (ActiveDocument.Styles(wdStyleNormal).Font.Size = 11 And _
       ActiveDocument.Styles(wdStyleNormal).Font.Name = "Arial") Then GoTo
EndLabel
   With ActiveDocument.Styles(wdStyleNormal)
       .AutomaticallyUpdate = False
       .BaseStyle = ""
       .NextParagraphStyle = "Normal"
   End With
   With ActiveDocument.Styles(wdStyleNormal).Font
       .Name = "Arial"
       .Size = 11
   End With
EndLabel:
  ActiveDocument.AttachedTemplate.Saved = True
End Sub
Signature

Patricia D

Jezebel - 31 May 2006 01:24 GMT
Your code is modifying the definition of normal style in the activedocument.
This is a change to that document, so Word wants to save it. Are you
actually trying to save the change to the template itself?

> Help - I can't get rid of this question.  Using an AutoExec module, there
> is
[quoted text clipped - 23 lines]
>   ActiveDocument.AttachedTemplate.Saved = True
> End Sub
Patricia D - 31 May 2006 01:49 GMT
Yes - I am actually trying to change the (default font in) the Normal Style
in the normal.dot template.
Signature

Patricia D

> Your code is modifying the definition of normal style in the activedocument.
> This is a change to that document, so Word wants to save it. Are you
[quoted text clipped - 27 lines]
> >   ActiveDocument.AttachedTemplate.Saved = True
> > End Sub
Jezebel - 31 May 2006 02:06 GMT
Try this

   With Templates("Normal.dot").OpenAsDocument
       With .Styles(wdStyleNormal).Font
           .Size = 11
           .Name = "Arial"
       End With
       .Close Savechanges:=True
   End With

> Yes - I am actually trying to change the (default font in) the Normal
> Style
[quoted text clipped - 36 lines]
>> >   ActiveDocument.AttachedTemplate.Saved = True
>> > End Sub
Patricia D - 31 May 2006 03:58 GMT
Thank you - it pretty much did the trick.  It left one problem that current
normal style was not updated, but that only affected current document for
this session of Word, so I can live with that knowing that all future uses
will be fixed for good.
I forgot to mention I'm using Word 2007 (Beta), so I just changed the
normal.dot to normal.dotm.  

Signature

Patricia D

> Try this
>
[quoted text clipped - 46 lines]
> >> >   ActiveDocument.AttachedTemplate.Saved = True
> >> > End Sub
Jezebel - 31 May 2006 04:30 GMT
Use

ActiveDocument.UpdateStyles

to copy the styles from the template to the document.

> Thank you - it pretty much did the trick.  It left one problem that
> current
[quoted text clipped - 58 lines]
>> >> >   ActiveDocument.AttachedTemplate.Saved = True
>> >> > End Sub
Patricia D - 31 May 2006 04:43 GMT
Thank you.  I'm happy with that.
Signature

Patricia D

> Use
>
[quoted text clipped - 64 lines]
> >> >> >   ActiveDocument.AttachedTemplate.Saved = True
> >> >> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.