Protect Form macro errors

H

hermithead

When I activate the Protect Form function on my templates and then
open them via a 3rd party preview screen I get a series of error
messages before the macro works. I need to protect the form for the
form fields to work and the templates are for a 3rd party system so I
cant have these errors appearing. The errors persist with the AutoOpen
macro and I cant set up an entry macro as the form needs to be
protected for that to happen - a bit of a catch 22!! Any ideas would
be appreciated.
 
T

Tony Jollans

In order to have a chance of helping I have to have some perinent
information but you don't give it - Catch 22, indeed.

What third party tool? What does it do? What error messages? What code do
you have? What code do you need? What difference (if any) does AutoOpen
make? etc., etc. All I know at the moment is that you have an error in a
third party tool, for which this is not a support forum.
 
H

hermithead

Thanks Tony.

The third party tool is an Inhouse IS, very old technology, Oracle
forms, and in my role I'm stuck with it. It's used for processing
customer applications, at various stages in the application process
compliance Letters are generated and sent to customers. We load
various letter templates into the IS but up to now they haven't been
forms. How the IS works: Letters are generated and then displayed in a
preview screen within the IS, to open them in Word they need to be
double clicked. It is at this point that the macro error messages
occur (I cant pass on the error messages atm but will do once back at
work tomorrow). Once the series of errors are closed the macro will
then work. My solution was to include a macro which upon opening the
letter would activate the Protect Form button. However the macro
attempts to run in the IS's preview screen prior to Word which I
assume causes the errors.
What I would like is code that performs a Protect Form function on a
single mouse click once the Letter has been opened in Word (and not
int the preview screen).
My current workaround is displaying a macro button instructing the
user to click and protect the form before filling it out. Ofcourse
this would be best automated.
 
T

Tony Jollans

So you have an Oracle Form and you are trying to invoke Word from within (a
control in) it? And your Word Document (or attached Template?) contains
Auto-macros that try to invoke functionality in your in-house tool? I will
happily look at the error messages but I don't know if I will be able to
help if my understanding so far is correct.
 
H

hermithead

Yep your understanding is correct but the auto-macros are not intended
to perform any functionality within the inhouse tool, the inhouse tool
is only storing the
templates, the only functionality is in the Word templates. But it
seems that when the templates appear in the inhouse preview screen
errors start to display.
Hopefully the error messages are more easier to understand.
Can macros be created for a single mouse click?
If so, I can link this to my Protect Forms macro on exit.
 
T

Tony Jollans

Thanks for e-mailing me the messages. The first is a Wordbasic command, the
second non-specific but it seems likely the code is old. That is about all I
can tell, except that I seem not to have understood the set up and where
this code is running from. I appreciate you may not know exactly what is
happening but can I you tell me ..

Have you created a template - or a document based on a template? And is this
a Word template of a component of your tool?

Are your letters generated in Word, or outside it? In other words what
entities exist 'up front' and what ones are created during the process in
error.
 
H

hermithead

I've created a Word template and the letters are generated in Word. So
the template is loaded into the IS and when required a letter is
generated and displays in a preview screen and then once you double
click it in this preview screen it opens up in word.
I had a quick chat with our Oracle programmer and his guess is its an
Oracle setting that causes the error. Since no other templates use
forms it is very likely this is the problem. So you were correct from
the outset :)
Unfortunatley for him to look into this further will mean a cost
charge to our section.
Just thinking out loud...If I'm running a ProtectForm macro on startup
(AutoNew) will this conflict with the in-built function called
ProtectForm? surely it wouldnt as the macro names will be different ie
AutoNEW and ProtectForm.
 
T

Tony Jollans

Let me think out loud, too ...

I keep thinking I have a handle on this, but I don't. I think maybe the
preview screen is confusing me, at least partly. I am assuming that the
problem does not occur if you create your document from your template
outside the Oracle container - if so, the cause is within the Oracle system
somewhere (that's not to say you can't address it yourself); if not then the
Oracle side has nothing to do with it. I am also assuming that you don't
have control over the code in the Template. What I haven't got is where the
failing code is and who controls it - if it's in a template that you created
then you can, presumably, change it. If its somewhere else, I'm not sure how
it's fired. Now, if it's your code, all you need to do is unprotect the form
while the code is trying to write to the document and then reprotect it
afterwards (well, that's all that needs doing anyway). The more I try to
make sense of the sequence of events here the more I struggle. The failing
code runs after your document has been opened (or during the open process)
so is in, or invoked from, your template so can you amend it? If not, I
think I'm more confused than ever ...

--
Enjoy,
Tony

I've created a Word template and the letters are generated in Word. So
the template is loaded into the IS and when required a letter is
generated and displays in a preview screen and then once you double
click it in this preview screen it opens up in word.
I had a quick chat with our Oracle programmer and his guess is its an
Oracle setting that causes the error. Since no other templates use
forms it is very likely this is the problem. So you were correct from
the outset :)
Unfortunatley for him to look into this further will mean a cost
charge to our section.
Just thinking out loud...If I'm running a ProtectForm macro on startup
(AutoNew) will this conflict with the in-built function called
ProtectForm? surely it wouldnt as the macro names will be different ie
AutoNEW and ProtectForm.
 
H

hermithead

Ha ha sorry to bamboozle you Tony.

If your keen (mostly from curiosity now I guess lol) let me put
together some screenshots of the whole process from the inhouse tool
through to word along with the code Im using.

Cheers again,
Dave :)
 

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