I need to search-and-replace on a docx file, i used this project : Simple DocX Editor in Native C#
at first time it doesn't work because i have as operating system windows 8 so i made some modification :
Shell shell = new Shell();
Folder archive = GetShell32NameSpace(archiveFile);//shell.NameSpace(Path.GetFullPath(archiveFile));
Folder extractFolder = GetShell32NameSpace(unArchiveFolder);//shell.NameSpace(Path.GetFullPath(unArchiveFolder));
public static Shell32.Folder GetShell32NameSpace(Object folder)
{
Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
Object shell = Activator.CreateInstance(shellAppType);
return (Shell32.Folder)shellAppType.InvokeMember("NameSpace", System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { folder });
}
Now it work for me well, but when i deployed in windows server 2012, it gives me this error
Can someone gives me some informations or any help to solve this problem! thanks in advance
i m sorry for my bad english!