jant
February 1st, 2005, 04:51 AM
If someone could help me with these problems..
Problem I:
Can I use API calls to invoke Save - button click in "Save As" - window in Office 2003? I can find the handle to the window, but I haven't find a way to invoke calls to dialog.
I've used this call: SendMessage(GetDialogItem(saveAsWndHandle, DialogItem), BN_CLICK, 0, 0);
(DialogItem???... I have tried to find the id with Spy++, but I didn't find it... also I need a id for File name field)
Save As - window is already opened for the user and then I find the handle for that window (saveAsWndHandle). Now when we've the handle we need to make API call which invokes save button call in the Save As - window (dialog).
Problem II:
using Excel = Microsoft.Office.Interop.Excel;
I need to find a excel workbook what user is currently using. I can find a workbook with:
Excel.Workbook wb = (Excel.Workbook)System.Runtime.InteropServices.Marshal.BindToMoniker("Book1");
The problem comes when I need to find a workbook which is saved to the internet, like:
http://test/test.doc. When I'm using that function above, it return unauthorized which shouldn't be like that. Current user has rights to go to that address. When I was doing client request (WebClient) to that internet address I needed to give DefaultCredentials which worked, but in this case I don't know where to put those default credentials.
And one thing more that is there any way to get an object from a window handle? Like if I've handle of Excel workbook window, I could get that workbook object with that handle?
Problem I:
Can I use API calls to invoke Save - button click in "Save As" - window in Office 2003? I can find the handle to the window, but I haven't find a way to invoke calls to dialog.
I've used this call: SendMessage(GetDialogItem(saveAsWndHandle, DialogItem), BN_CLICK, 0, 0);
(DialogItem???... I have tried to find the id with Spy++, but I didn't find it... also I need a id for File name field)
Save As - window is already opened for the user and then I find the handle for that window (saveAsWndHandle). Now when we've the handle we need to make API call which invokes save button call in the Save As - window (dialog).
Problem II:
using Excel = Microsoft.Office.Interop.Excel;
I need to find a excel workbook what user is currently using. I can find a workbook with:
Excel.Workbook wb = (Excel.Workbook)System.Runtime.InteropServices.Marshal.BindToMoniker("Book1");
The problem comes when I need to find a workbook which is saved to the internet, like:
http://test/test.doc. When I'm using that function above, it return unauthorized which shouldn't be like that. Current user has rights to go to that address. When I was doing client request (WebClient) to that internet address I needed to give DefaultCredentials which worked, but in this case I don't know where to put those default credentials.
And one thing more that is there any way to get an object from a window handle? Like if I've handle of Excel workbook window, I could get that workbook object with that handle?