Hi
I have a pretty complicated problem. I have a Word document with a table and some macros that can send the table information to another application. This is done by activating the Word document and hitting a shortcut. This works perfectly.
My problem is that I want the Word document to be as "invisble" as possible while I execute my macros by using the shortcuts. So far I resized the Word window displaying the document to its smallest possible size, and the using the windows Taskbar to activate it.
This however causes Word to open subsequent documents in this minimal (not minimized) size, and I don't want to resize all of these.
My approach so far has been using an EventClassModule so that this code is run when opening other word documents:
Public WithEvents appWord As Word.Application
Private Sub appWord_DocumentChange()
If ActiveWindow.Document.Name <> "NameOfSmallDocu.doc" Then
ActiveDocument.ActiveWindow.Width = 800
ActiveDocument.ActiveWindow.Height = 600
ActiveDocument.ActiveWindow.Left = 0
ActiveDocument.ActiveWindow.Top = 0
End If
End Sub
This automatically resizes all other documents, but this is not completely satisfactory. First of all it generates a debug error when closing the last open Word Document (since there no longer is a document with a name).
Is there anyone who can think of a different approach to hiding my document without influencing all other instances of Word?
Jens Busse
Workflow Consultant
CCI Europe A/S
I have a pretty complicated problem. I have a Word document with a table and some macros that can send the table information to another application. This is done by activating the Word document and hitting a shortcut. This works perfectly.
My problem is that I want the Word document to be as "invisble" as possible while I execute my macros by using the shortcuts. So far I resized the Word window displaying the document to its smallest possible size, and the using the windows Taskbar to activate it.
This however causes Word to open subsequent documents in this minimal (not minimized) size, and I don't want to resize all of these.
My approach so far has been using an EventClassModule so that this code is run when opening other word documents:
Public WithEvents appWord As Word.Application
Private Sub appWord_DocumentChange()
If ActiveWindow.Document.Name <> "NameOfSmallDocu.doc" Then
ActiveDocument.ActiveWindow.Width = 800
ActiveDocument.ActiveWindow.Height = 600
ActiveDocument.ActiveWindow.Left = 0
ActiveDocument.ActiveWindow.Top = 0
End If
End Sub
This automatically resizes all other documents, but this is not completely satisfactory. First of all it generates a debug error when closing the last open Word Document (since there no longer is a document with a name).
Is there anyone who can think of a different approach to hiding my document without influencing all other instances of Word?
Jens Busse
Workflow Consultant
CCI Europe A/S