The .Workbooks.Open() has a password parameter to it.

http://msdn.microsoft.com/en-us/library/bb179167.aspx

-----Original Message-----
From: Rafael Copquin
Sent: Tuesday, September 30, 2008 1:45 PM

I need to save Word and Excel documents using passwords.

What command should I use to open those documents directly from VFP, without
human intervention?

The passwords are only known to management and I was asked to embed them
into the calling forms.

So for instance, I would open the document thus:

lparameter cSheet

If !PemStatus(thisform,'oExcel',5)
   thisform.AddProperty('oExcel')
EndIf


if upper(vartype(this.oExcel)) <> "O"
   thisform.oExcel = createobject("Excel.Application") else
   thisform.oExcel=getobject(,"Excel.Application")
endif


with this.oExcel
        .Workbooks.Open(cSheet)
       .visible = .t.
endwith

In the above scenario I have to also send the password, so what code should
I write?

TIA

Rafael Copquin





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to