Problem with sharing templates

H

Henrik B.

Hello,

I have a very strange problem. I have made a simple template in word 2000
proffesional edition. It have a user form with some multipages on it just to
keep some sort of nice layout. After filling in information on the userform
the user can click a button (the only one) that then saves the answers to a
file.

This all works very nice on my own computer. But when i copy the dot-file to
another computer and then runs the template, the userform shows and you can
type in information. But when you click the button to save the information
nothing happens. I have checked almost everything, but may have overlooked
something:)) Does anybody in here knows what the problem is. I dont make
use of any calls to normal.dot or anything its just a "simple" template with
no fancy stuff in it.

I know that this might be a newbee question, but i just cant find a solution
to the problem i've looked almost everywhere - hope somebody can help.

Thanks in advance

Henrik.
 
S

Stephanie Krieger

Hi, Henrik,

Does the macro to move the content from the user form to
the document have an error handler? If so, have you tried
to comment it out (put an apostrophe in front of the line
of code that contains the 'On Error GoTo ...' line and
then run it on a machine where it doesn't work.

If that doesn't help -- can you answer these
questions ... Is the template self-contained? That is, is
the user form saved in the same template as the document
where the content is delivered to (do you know how to
determine this)? If not, please tell me what template
contains the userform and what template contains the
document where the information goes. Also, how are you
transfering the content? (such as bookmarks, or some
other method)?

Stephanie Krieger
author of Microsoft Office Document Designer (from
Microsoft Learning)
blog: arouet.net
 
D

David Sisson

. But when i copy the dot-file to
another computer and then runs the template,

Did you copy the DOT file to the templates directory?

Show us the click event for the button.
 
H

Henrik B.

Hi all.

Here is the code for the button. The sub Indsaet_I_Skema just writes the
information to the document - i did not include this because its not
actually part of the button. Hope this can help. I placed the dot file in
the standard template folder.

Private Sub Fortsaet_Click()

Open "C:\KRSporgeskema.txt" _
For Output As #1 'Åbner filen hvor spørgskemadata gemmes i
'Skriv data i filen
'Faneblad Person oplysninger
Print #1, Dato
Print #1, Sagsbehandler
Print #1, Cprnr
Print #1, Navn
Print #1, Alder
Print #1, Mand
Print #1, Kvinde
Print #1, Gift
Print #1, Ugift
Print #1, Skilt
Print #1, Samlevende

'Faneblad Arbejdssted & Varighed af sygdom
Print #1, Arbejdssted
Print #1, Ansatperiode
Print #1, ForsteSygedag
Print #1, Sygdombegrund
Print #1, VarighedDage
Print #1, VarighedUger
Print #1, VarighedMdr

'Faneblad Diagnose
Print #1, SygemeldtEget
Print #1, Diagnose
Print #1, UlykkeJa
Print #1, UlykkeNej
Print #1, BehandlingJa
Print #1, BehandlingNej
Print #1, BehandlDage
Print #1, BehandlUger
Print #1, BehandlMdr
Print #1, Behandling

'Faneblad Diagnose - Uddyb.
Print #1, KroniskJa
Print #1, KroniskNej
'Print #1, Kronisk <- Bliver ikke gemt da det ikke har noget med svaret at
gøre.
Print #1, KroniskHvad
Print #1, AftaleJa
Print #1, AftaleNej
Print #1, Forsorg1
Print #1, Forsorg2
Print #1, Forsorg3
Print #1, Forsorg4
Print #1, Dagpengesager

'Faneblad Arb.markedsforhold
Print #1, Erfa1
Print #1, Erfa2
Print #1, Perspektiv1
Print #1, Perspektiv2
Print #1, Perspektiv3
Print #1, Perspektiv4
Print #1, Perspektiv5
Print #1, Perspektiv6
Print #1, Perspektiv7

'Faneblad Arb. markedsforhold - Uddyb.
Print #1, Forhold1
Print #1, Forhold2
Print #1, Forhold3
Print #1, Forhold4
Print #1, Forhold5
Print #1, Arbejdslos1
Print #1, Arbejdslos2
Print #1, Arbejdslos3

'Faneblad Økonomi & Udd.
Print #1, Okon1
Print #1, Okon2
Print #1, Udd1
Print #1, Udd2
Print #1, Udd3
Print #1, Udd4
Print #1, Udd5
Print #1, Udd6
Print #1, Udd7
Print #1, Soc1
Print #1, Soc2
Print #1, Soc3
Print #1, Soc4

Close #1 'Luk filen
'MsgBox ("Tak for Deres besvarelse. Svarene er nu gemt i filen
C:\KRSporgeskema.txt")
MsgBox ("Tak for Deres besvarelse. Svarene er nu gemt i 2 filer") & Chr$(13)
& _
("Filen C:\KRSporgeskema.txt") & Chr$(13) & _
("Filen C:\KRSporgeskema.doc")
Indsaet_I_Skema
Me.Hide 'Skjuler dialogboksen til Spørgeskemaet
Unload Me 'Luk dialogboksen

End Sub
 
D

David Sisson

When you view the userform object, double click the button that
activates the routine.. It should take you to the routine you
included. If it doesn't, and it adds a new event, then you've
misspelled the event name.

Add msgbox traps to see if the values are actually making it into the
event.

Other than, I'm out of ideas.

Good luck
 
C

Chuck

Possibly silly question but are you sure that the files your code opens at
the beginning ("C:\KRSporgeskema.txt") exists on the user's computer? If it
doesn't then perhaps your code is trying to write to nothing?
 
H

Henrik B.

Hi david.

I just did what you wrote - and i get to the routine. Then i made a copy of
the code and deleted the whole routine (except the actual button), saved the
template again. Closed word and started it again. Then i Went in to the
click event for the button and pasted the code in again, saved the template
and then run the template and suddently it worked. I experienced the same
from time to time in lotus wordpro where i usually code.

But thanks to you and the the whole group for their help with this anoying
problem.

Henrik.
 

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