*I need to add password in Microsoft word, pdf and ppt doc. For that i have integrated 'MicrosoftWord.h' file and used SBApplication. And used below code to open the password protected doc. self.wordApp = [SBApplication applicationWithBundleIdentifier:@"com.microsoft.word"]; self.wordApp.delegate = self; [self.wordApp activate];
if ([self.wordApp isRunning]) {
MicrosoftWordDocument *activeDocument = [self.wordApp activeDocument];
[activeDocument openFileName:FilePath
confirmConversions:NO
readOnly:NO
addToRecentFiles:NO
passwordDocument:@""
passwordTemplate:@""
Revert:NO
writePassword:@"1"
writePasswordTemplate:@""
fileConverter:MicrosoftWordE162OpenFormatDocument97];
}
But it's giving me below error while opening password protected doc. Cannot open Error Domain=NSOSStatusErrorDomain Code=-1708 "errAEEventNotHandled: the AppleEvent was not handled by any handler " UserInfo={ErrorNumber=-1708} Please help me in below two cases. 1. How to open password protected Microsoft word doc using objective-c ? 2. How to create password protected word doc using objective -c ?*
I Have resolved this, Please read answer.
Now, I am stuck at another problem. All I need to create Header file for Microsoft Power Point,Microsoft Excel and Adobe Reader. I have referred below Stack Over Flow Link.
Scripting bridge and generate Microsoft Word header file
I have created PowerPoint Header file using
$ sdef /Applications/Microsoft\ Office\ 2011/Microsoft\ PowerPoint.app | sdp -fh --basename MicrosoftPowerPoint
But it is giving me error while building the app.
ERROR: MicrosoftPowerPoint.h:3028:2: Redefinition of enumerator 'MicrosoftPowerPoint4006ShapeRange'
Any one please help me, After creating Header file does it requires to add any script or settings in the app. I need to integrate this module in the same mac app in which i have integrated "MicroSoftWord.h".
Thanks in advance.