|
-
Jan 6th, 2003, 04:19 AM
#1
Thread Starter
Junior Member
Office Automation
Hi!
I am writing an application that will identify Save and Close all editable applications running on the PC like Word, Excel, PowerPoint etc. on the click of a command button. followinf is the code for identifying and saving MS Word:-
Do While (FindWindow("OpusApp", vbNullString)) <> 0
WinWnd1 = FindWindow("OpusApp", vbNullString)
ShowWindow WinWnd1, SW_SHOWNORMAL
Dim x As Word.Application
Set x = GetObject(, "Word.Application")
AppActivate "Microsoft Word"
x.ActiveDocument.SaveAs "C:\Word" & i & ""
x.Quit
Set x = Nothing
i = i + 1 'i is declared before as a static variable
Loop
This codes works fine if one or any number of Word Application (SDI) is opened. However if only one Word is opened and more than one document (MDI) is opened on that Word application then one document is saved and than the dialog box asking for saving the application popup and asks for file name. I want that it the dialog box shouldn't appear and it should save those MDI documents with different file names.
Anyone please help me .....
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
|