Template - Save changes

J

judith

I have seen several questions on the Save chages to templte messages but I
think my question is a bit different.
I have a custom template that has a save button. The macro automatically
generates a file name and saves the document to the correct loaction. This
has been working fine but one of the users has just had a new machine and now
persistantly gets the "save changes to template" message. The other users are
all still fine. Is there anything I should look for in the Word set up on
this machine? Unfortunately the customer is still running Word 2000

Thanks
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :
I have seen several questions on the Save chages to templte messages
but I think my question is a bit different.
I have a custom template that has a save button. The macro
automatically generates a file name and saves the document to the
correct loaction. This has been working fine but one of the users has
just had a new machine and now persistantly gets the "save changes to
template" message. The other users are all still fine. Is there
anything I should look for in the Word set up on this machine?
Unfortunately the customer is still running Word 2000

Thanks

Show us the relevant code.
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :


Show us the relevant code.
Code

Sub DraftSave()
'
' fullname Macro
' Macro recorded 17/06/2002 by Judith
'
Dim TemplatePath As String
Dim FilNam As String
Dim letNo As String
Dim createDat As String
Dim TestString As String

Rem error handling

On Error GoTo errStuff

letNo = ActiveDocument.Bookmarks("LetterNo").Range.Text
createDat = Now
FilNam = ActiveDocument.Bookmarks("LetterSubject").Range.Text

FilNam = FilNam & letNo & " " & createDat

Rem Save Document to template location

TemplatePath = ActiveDocument.AttachedTemplate.Path
TestString = TemplatePath & "\" & FilNam & ".Doc"
ActiveDocument.SaveAs (TestString)

Exit Sub

errStuff:
MsgBox ("Document NOT saved. Check that Subject and REF are completed
before saving")

End Sub


I am puzzled as it is only the one machine that persists in giving the "save
changes to template" message. Could this be a setting in Word rather than a
template.

Thanks
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :
Code

Sub DraftSave()
'
' fullname Macro
' Macro recorded 17/06/2002 by Judith
'
Dim TemplatePath As String
Dim FilNam As String
Dim letNo As String
Dim createDat As String
Dim TestString As String

Rem error handling

On Error GoTo errStuff

letNo = ActiveDocument.Bookmarks("LetterNo").Range.Text
createDat = Now
FilNam = ActiveDocument.Bookmarks("LetterSubject").Range.Text

FilNam = FilNam & letNo & " " & createDat

Rem Save Document to template location

TemplatePath = ActiveDocument.AttachedTemplate.Path
TestString = TemplatePath & "\" & FilNam & ".Doc"
ActiveDocument.SaveAs (TestString)

Exit Sub

errStuff:
MsgBox ("Document NOT saved. Check that Subject and REF are
completed before saving")

End Sub


I am puzzled as it is only the one machine that persists in giving
the "save changes to template" message. Could this be a setting in
Word rather than a template.

Thanks

Is the person using that template on that machine actually creating a
document based on the template, IOW, are you sure they are not just opening
the template itself?
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :


Is the person using that template on that machine actually creating a
document based on the template, IOW, are you sure they are not just opening
the template itself?

--
______________________________
Jean-Guy Marcil
Montreal, Canada


The user just double clicks on the template file to open and it opens as Document 1 so I have no reason to believe that it is the template. Also this seems to work for the 12 other machines that use these templates. There are about 200 templates so I really dont want to change the coding for this one machine. I feel sure that it is just something in the setup that I have missed. Also it is Word 2000!

Thanks
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :


Does the message specifies which template it is trying to save?
Have you ascertained it was your template, and not, let's ay Normal.dot or
some other add-in that might be loaded?
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :



Does the message specifies which template it is trying to save?
Have you ascertained it was your template, and not, let's ay Normal.dot or
some other add-in that might be loaded?

--
______________________________
Jean-Guy Marcil
Montreal, Canada


It says that it is trying to save changes to my template

Judith
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :


What is the exact message?

--
______________________________
Jean-Guy Marcil
Montreal, Canada

I am not out at the site but it is something like
Save changes to Template XXX Yes No

And this message appears twice on occassions

Thanks
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :
I am not out at the site but it is something like
Save changes to Template XXX Yes No

And XXX is the name of the custom template you created?
And this message appears twice on occassions

What do you mean?
What is the exact sequence of event when it appears once and when it appears
twice?

Finally, you stated you weren't on site... Have you ever been on site, IOW,
are you stuck with trusting whatever the users says happens?

This has been the source of many frustrating misunderstandings before, this
is why I am asking all those questions, I want to make sure we have filtered
out all user interference...
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :



And XXX is the name of the custom template you created?


What do you mean?
What is the exact sequence of event when it appears once and when it appears
twice?

Finally, you stated you weren't on site... Have you ever been on site, IOW,
are you stuck with trusting whatever the users says happens?

This has been the source of many frustrating misunderstandings before, this
is why I am asking all those questions, I want to make sure we have filtered
out all user interference...

-- I have been on site many times and have seen these messages. The templates have worked for the last 5 years on up to 15 machines and it is only this one machine that I am having problems with. The user opens a document based on the template (Document 1 displayed at the top of the screen) But on saving the document through the macro they get
Do you want to save the changes to xxxx.dot (the template)

If you just save the document using the toolbar options it is OK.

I am sure it is something to do with the Word setup but can not find
anything obvious.
Thanks> ______________________________
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :
Do you want to save the changes to xxxx.dot (the template)

If you just save the document using the toolbar options it is OK.

I am sure it is something to do with the Word setup but can not find
anything obvious.
Thanks

I do see one problem with your code, but it has nothing to do with the
problem you are seeing, or, at least, I do not see how it could be related.

Your code has the following line:

createDat = Now

and this line should generate something like:

24/06/2009 11:56:08 AM

Then, you a re using this to build the file name you want to save.
However, "/" and ":" are not allowed as file name characters, so the file
cannot not be saved and your custom error message should be displayed.

I do not understand how you get that code to work in the first place, as is.
 
J

judith

Jean-Guy Marcil said:
judith was telling us:
judith nous racontait que :


I do see one problem with your code, but it has nothing to do with the
problem you are seeing, or, at least, I do not see how it could be related.

Your code has the following line:

createDat = Now

and this line should generate something like:

24/06/2009 11:56:08 AM

Then, you a re using this to build the file name you want to save.
However, "/" and ":" are not allowed as file name characters, so the file
cannot not be saved and your custom error message should be displayed.

I do not understand how you get that code to work in the first place, as is.

--
______________________________
Jean-Guy Marcil
Montreal, Canada

I use a routine to strip these out. I still think it is a word set up problem. I will just try reloading office Thanks
 
J

Jean-Guy Marcil

judith was telling us:
judith nous racontait que :

So the code you posted is not the one you are actually using?

The only settings that has to do with saving templates is the setting that
asks users whether they want to save changes to Normal.dot.

There are no such settings for custom templates.

So, if you get that message, it definitely means that the template was
changed or affected.
Now, since you are getting this message on one machine only, which uses the
same Windows/Word version as other machines, it means that your code is
affecting that machine in a different manner, probably a theWindows level.

When you have a chance, do a step by step debug on that machine to see which
line might affect the saved status of the template.

You could add the following line in the middle of the code:

MsgBox AttachedTemplate.Saved

If it returns true, it means the template has not been affected yet, so move
the MsgBox line down a bit and run it again, etc.

Do this until you find which line actually affects your template saved
status.
Once you know which line, it should be easy to fix.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top