Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii friends,
I am currently working on office automation project using office 2010. I have one master excel file, from which i pick up data and opening word application and document object, put data for each field present on word document. So it makes number of word files for each record. While creating word files, it appears in desktop window. I have to hide it from being displaying. I also set application.visible=false; but it shows the window. so please give me correct solution to hide window.
Posted

1 solution

Are you sure you set visible property of the word application? In the context of excel, application refers to excel itself.
Word.Application.Visible = false

Good luck!
 
Share this answer
 
v2
Comments
Rahul Masalkar 23-Nov-12 2:37am    
application.visible=false;
application in the current code is object of word application.
So, do u have any other idea?
E.F. Nijboer 23-Nov-12 9:29am    
Okay, because you mention "I have one master excel file, from which i pick up data and opening word application and document object". Reading that, my idea was that your code is running from within excel and not word.
You can also try opening the word document hidden, using this:
Set doc = Word.Documents.Open(FileName:=DocFilename, Visible:=False)
Rahul Masalkar 26-Nov-12 1:38am    
again this doesn't give solution. Thanks for help. I need other option.
E.F. Nijboer 26-Nov-12 3:21am    
You can also try this:
oDoc.Windows(1).Visible = False
oDoc.ActiveWindow.Visible = False
Rahul Masalkar 26-Nov-12 4:31am    
Problem not solved but good efforts. Thanks E.F. Nijboer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900