以上是编辑模式,以下是播放模式
请问如何用类库Microsoft.Office.Interop.Powerpoint.dll 进行两者之间的切换。。。
目前 豆少 解决了 再追加!!!
WindowAPI 键盘鼠标事件 同时搞起 搞定!!! [DllImport("user32.dll")] public static extern UInt32 SendInput(UInt32 nInputs, ref INPUT pInputs, int cbSize); [StructLayout(LayoutKind.Explicit)] public struct INPUT { [FieldOffset(0)] public Int32 type; [FieldOffset(4)] public KEYBDINPUT ki; [FieldOffset(4)] public MOUSEINPUT mi; [FieldOffset(4)] public HARDWAREINPUT hi; } [StructLayout(LayoutKind.Sequential)] public struct MOUSEINPUT { public Int32 dx; public Int32 dy; public Int32 mouseData; public Int32 dwFlags; public Int32 time; public IntPtr dwExtraInfo; } [StructLayout(LayoutKind.Sequential)] public struct KEYBDINPUT { public Int16 wVk; public Int16 wScan; public Int32 dwFlags; public Int32 time; public IntPtr dwExtraInfo; } [StructLayout(LayoutKind.Sequential)] public struct HARDWAREINPUT { public Int32 uMsg; public Int16 wParamL; public Int16 wParamH; } public const int INPUT_KEYBOARD = 1; public const int KEYEVENTF_KEYUP = 0x0002; [System.Runtime.InteropServices.DllImport("user32")] private static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); const int MOUSEEVENTF_MOVE = 0x0001; //移动鼠标 const int MOUSEEVENTF_LEFTDOWN = 0x0002; //模拟鼠标左键按下 const int MOUSEEVENTF_LEFTUP = 0x0004; //模拟鼠标左键抬起 const int MOUSEEVENTF_RIGHTDOWN = 0x0008; //模拟鼠标右键按下 const int MOUSEEVENTF_RIGHTUP = 0x0010; //模拟鼠标右键抬起 const int MOUSEEVENTF_MIDDLEDOWN = 0x0020; //模拟鼠标中键按下 const int MOUSEEVENTF_MIDDLEUP = 0x0040; //模拟鼠标中键抬起 const int MOUSEEVENTF_ABSOLUTE = 0x8000; //标示是否采用绝对坐标 INPUT inDown = new INPUT(); mouse_event(MOUSEEVENTF_MOVE, 0, 100, 0, 0); mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); inDown.type = INPUT_KEYBOARD; inDown.ki.wVk = (short)KeyInterop.VirtualKeyFromKey(Key.LeftCtrl); inDown.ki.dwFlags = 0; // 按下Ctrl键 SendInput(1, ref inDown, Marshal.SizeOf(inDown)); // 按下S键 inDown.ki.wVk = (short)KeyInterop.VirtualKeyFromKey(Key.E); SendInput(1, ref inDown, Marshal.SizeOf(inDown)); inDown.ki.dwFlags = KEYEVENTF_KEYUP; // 放开S键 SendInput(1, ref inDown, Marshal.SizeOf(inDown)); inDown.ki.wVk = (short)KeyInterop.VirtualKeyFromKey(Key.LeftCtrl); // 放开Ctrl键 SendInput(1, ref inDown, Marshal.SizeOf(inDown)); //mouse_event(MOUSEEVENTF_MOVE, 0, -(int)btnEdit.ActualHeight, 0, 0);
我目前做的和你一样 我的解决方案是 PPT->PDF->SWF 最后播放的是SWF 在本地运行没有问题,但是发布在IIS遇到内存不足无法执行,目前苦恼中 不过换用方法生成PDF和SWF文件 也行解决最终的方案
转成SWF 就没有编辑功能了 我这边需要编辑ppt的功能。要不然就不用webbrowser了 而是 把ppt-》图片 自己灵活处理了。
@我想成为技术大咖: 看你的要求比我的还复杂,顶一下!说不定以后我们的需求也会发展到你那一步!