|
-
Jan 7th, 2005, 02:43 AM
#1
Thread Starter
New Member
Qry Resolved:setting password to a powerpoint file using Visual basic
hi there
i m facing a prblm while setting password to a powerpoint file from my visual
basic appln.
Through my vb application i create an object of ms powerpoint.
using this object i open a required powerpoint file
then using the password property i assign password to that
powerpoint file and save tht file
but when i open tht file it does not ask me for the password that i
had set from my vb application
The code that i m using is as follows:
Dim oPPTApp As PowerPoint.Application
Dim oPPTPres As PowerPoint.Presentation
Dim sPresentationFile As String
sPresentationFile = strSource
' Get a reference to PowerPoint app
Set oPPTApp = New PowerPoint.Application
' MUST set it visible or you get errors
oPPTApp.Visible = True
' minimize if you want to hide it:
oPPTApp.WindowState = ppWindowMinimized
' Open our source PPT file, get a reference to it
Set oPPTPres = oPPTApp.Presentations.Open(sPresentationFile)
'oPPTApp.ActivePresentation.Password = Trim(txtPassword)
' oPPTPres.Application.ActivePresentation.Password = Trim(txtPassword)
'oPPTPres.Password = Trim(txtPassword)
oPPTApp.Presentations.Application.ActivePresentation.Password = Trim(txtPassword)
' Cleanup
' Close the presentation
oPPTPres.Close
' Quit PPT
oPPTApp.Quit
' Release variables
Set oPPTPres = Nothing
Set oPPTApp = Nothing
please send me some piece of code that will associate the password i pass
from my vb application to the powerpoint file
thanks and regds
paresh surve
Last edited by paresh.surve; Jan 7th, 2005 at 05:34 AM.
Reason: qry Resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|