Word Protection Issue

W

Wez

Hi All,

I have a word document that I am using as a template. I have fields
and text fields on the document. The fields in the document should be
dynamically populated by an ABAP program. The fields are going to be
populated by the user. The document is protected using the "readonly"
function and the exceptions for the textfields and the fields
(variables) have been created. The problem I am having is that when
the document is launched by the program, my fields (variables) are not
getting populated. The document works fine when it is not protected,
but the problem comes when I protect the document. The exceptions for
the fields and textfields have been created. When the document is
launched I can type in the textfields and the fields. So in theory, it
should work. What am I doing wrong?

And if anyone is really familiar with this word protection, I would
like to know if i can dynamically remove an exception from a field so
that once the document is launched and a field is populated, the user
will not be able to alter that particular field.

Thanks in advance
 
R

Robert M. Franz (RMF)

Hi Wez
I have a word document that I am using as a template. I have fields
and text fields on the document. The fields in the document should be
dynamically populated by an ABAP program.

Fields and text fields -- ahem, that doesn't tell us much, sorry: I take
it the two (ABAP/user fields) are different, but in what?

The fields are going to be
populated by the user. The document is protected using the "readonly"
function and the exceptions for the textfields and the fields
(variables) have been created. The problem I am having is that when
the document is launched by the program, my fields (variables) are not
getting populated. The document works fine when it is not protected,
but the problem comes when I protect the document. The exceptions for
the fields and textfields have been created. When the document is
launched I can type in the textfields and the fields. So in theory, it
should work.

Well, in theory it should work when your file is not protected -- but it
is!

A possible solution: only protect the document when the ABAP part is over.

And if anyone is really familiar with this word protection, I would
like to know if i can dynamically remove an exception from a field so
that once the document is launched and a field is populated, the user
will not be able to alter that particular field.

Then, before protecting the document, convert the ABAP "fields"
(whatever they are) into normal text. Or, depending on the mechanism,
they don't need to be fields to begin with ...

HTH
Robert
 
W

Wez

Hi Robert,

Thanks for your reply

We have actually decided to only protect the document once the
population has been done.
I want to send the password to the document and call the protection
method in the VB code.
I am having some troubles calling the VB macro directly from SAP so I
have decided to use another work-around. I want to populate a text box
with the password and then trigger an onchange event which will call
the protection method. Word, however will not allow me to place a
MailMergeField value into a textbox...

Do you know how I can retrieve a value from ABAP and use it in my VB
code?
 
R

Robert M. Franz (RMF)

Wez wrote:
[..]
I am having some troubles calling the VB macro directly from SAP so I
have decided to use another work-around. I want to populate a text box
with the password and then trigger an onchange event which will call
the protection method. Word, however will not allow me to place a
MailMergeField value into a textbox...

Do you know how I can retrieve a value from ABAP and use it in my VB
code?

sorry, I'm no developer (at all :)).

No idea how much support you'll get in the .vba newsgroups, maybe you
want to look for an SAP forum right away ...

0.2cents
Robert
 

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