Hi
I'm using Word automation to interact between Word and an ASP page. Inside the script I have the following code :
Set objWord = CreateObject("Word.Application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objWord.Visible = true
Set objDoc = objWord.Documents.Open ("Test.doc"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objDoc.Activate
objDoc.ActiveWindow.Selection.EndOf
'???
SaveLoc = "c:\temp\Test.doc"
objDoc.SaveAs SaveLoc
Is there a way to make the script wait at a certain point (where the question marks are written)? I'd like the user to be able to modify the document (which is loaded and displayed with the previous code lines). Then he/she could press a button (with some macro behind it) that makes the script continue (i.e. the file is saved to disk). Does anyone have an idea what I could write to make the script hold (a hidden confirmation dialog or so) and that can be disabled by a user's interaction (macro, Word command, etc.)?
A second question : how can be determined if an object variable is active? What I mean is, how can I determine if the objWord object is actually assigned to an open Word application? I know it should be assigned at startup, but I need to prevent errors when the user closes the Word application and objDoc actions are still called in the script.
Thanks.
I'm using Word automation to interact between Word and an ASP page. Inside the script I have the following code :
Set objWord = CreateObject("Word.Application"
objWord.Visible = true
Set objDoc = objWord.Documents.Open ("Test.doc"
objDoc.Activate
objDoc.ActiveWindow.Selection.EndOf
'???
SaveLoc = "c:\temp\Test.doc"
objDoc.SaveAs SaveLoc
Is there a way to make the script wait at a certain point (where the question marks are written)? I'd like the user to be able to modify the document (which is loaded and displayed with the previous code lines). Then he/she could press a button (with some macro behind it) that makes the script continue (i.e. the file is saved to disk). Does anyone have an idea what I could write to make the script hold (a hidden confirmation dialog or so) and that can be disabled by a user's interaction (macro, Word command, etc.)?
A second question : how can be determined if an object variable is active? What I mean is, how can I determine if the objWord object is actually assigned to an open Word application? I know it should be assigned at startup, but I need to prevent errors when the user closes the Word application and objDoc actions are still called in the script.
Thanks.