Link to home
Start Free TrialLog in
Avatar of npuleio
npuleio

asked on

creating a word document by WordApplication with custom template

Hello everyone,

anyone could suggest me how I can create a new word document from a custom template authenticated by user/password with WordApplication not visible so I can update only two places automatically then saving in another folder and printing as PDF?.....

Thanks to all!
Ciao,
Luigi
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

What language are you trying to write this program in?  
Avatar of npuleio
npuleio

ASKER

Hello,

I use C++ Builder...
Then you should be in that application zone. I will move the question for you.  I doubt if you're going to get any answers in the Word forum.

Joanne Orzech
MS Word MVP
EE Zone Advisor
Oh my apologies evilrix!  And my thanks for straightening this out....

Joanne
Avatar of evilrix
>> thanks for straightening this out
No worries, my pleasure.
Avatar of npuleio

ASKER

At least, anyone knows why if I write:

WordApplication->ActiveDocument->Shapes->AddTextEffect(msoTextEffect1, "text", "Arial Black", 1, msoFalse, msoFalse, 0, 0)

C++ Builder couldn't find a match?...
Avatar of npuleio

ASKER

OK here I am... I did some investigations and tests around Word.Application....

I have a template .dot which has read-password and write-password... how I would set the wordapplication as here:

WordDoc = WordDocs.OleFunction("Add", OleVariant(path_of_template_name.dot,...)

to pass automatically passwords?....
If I do

WordDoc = WordDocs.OleFunction("Add", OleVariant(path_of_template_name.dot,false, 1);
then
WordDoc.OlePropertySet("PasswordTemplate") = passwordtemplate;
WordDoc.OlePropertySet("WritePasswordTemplate") = passwordtemplate;

indeed executing OleFunction(...), Word opens and asks me directly the password instead of executing OlePropertySet... how I can figure that out?...

Thanks
Ciao
Luigi
ASKER CERTIFIED SOLUTION
Avatar of npuleio
npuleio

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial