Click to See Complete Forum and Search --> : no toolbar in word ??
trasher
September 4th, 2001, 04:10 PM
My app is opening a specific word file with the object "word.application". But , I'm not able to make the word's toolbar visible...
here:s my code
Set wrdApp = CreateObject("word.application")
wrdApp.Documents.Open("FilePath")
wrdApp.Application.ScreenUpdating = True
wrdApp.Application.WindowState = wdWindowStateMaximize
wrdApp.Application.Visible = True
Set wrdApp = Nothing
Make it with rocker style \w/
Cimperiali
September 5th, 2001, 05:37 AM
Set wrdapp = CreateObject("word.application")
wrdapp.Documents.Add 'you forgot this line
wrdapp.Documents.Open filepath
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
trasher
September 5th, 2001, 06:58 AM
The line
wrdApp.Documents.Add
don't seems to change anything...
I really don't know what it is...
Make it with rocker style \w/
Cimperiali
September 5th, 2001, 07:26 AM
Dim filePath as string
filePath = "d:\gestioneerrori.doc" 'your pathfilename.doc
set wrdApp = CreateObject("word.application")
wrdApp.Documents.Add "c:\program files\Microsoft Office\Modelli\Normal.dot" 'search for your path to Normal.dot
wrdApp.Documents.Open filePath
wrdApp.Application.ScreenUpdating = true
wrdApp.Application.WindowState = wdWindowStateMaximize
wrdApp.Application.Visible = true
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
trasher
September 5th, 2001, 07:46 AM
huumm the only thing I have is the scroll bars and rulers at the top.
I think I will use the shell function instead by using word.application.path to find the .exe
Thanks for help :o)
Make it with rocker style \w/
Cimperiali
September 5th, 2001, 07:58 AM
I think I find out:
wdapp.Application.WindowState = wdWindowStateMaximize
is making the mess up!
you can do a different instantiation:
put a reference to Microsoft Word 8.0 (or 9.0) object library
then:
Dim filePath as string
filePath = "d:\gestioneerrori.doc"
'set wrdApp = CreateObject("word.application")
'wrdApp.Documents.Add "c:\program files\Microsoft Office\Modelli\Normal.dot"
'wrdApp.Documents.Open filePath
'wrdApp.Application.ScreenUpdating = true
'wrdApp.Application.WindowState = wdWindowStateMaximize
'wrdApp.Application.Visible = true
'set wrdApp = nothing
Dim wdapp as Word.Application
set wdapp = new Word.Application
wdapp.Documents.Add '"c:\program files\Microsoft Office\Modelli\Normal.dot"
wdapp.Documents.Open filePath
wdapp.Application.ScreenUpdating = true
wdapp.Application.Windows(1).Activate
wdapp.Application.WindowState = wdWindowStateNormal '(this is ok)
'wdapp.Application.WindowState = wdWindowStateMaximize 'this make menu disappear
wdapp.Application.Visible = true
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cimperiali
September 5th, 2001, 08:08 AM
Even this seems to work
(at least on my machine)
Dim filePath as string
filePath = "d:\gestioneerrori.doc"
set wrdApp = CreateObject("word.application")
wrdApp.Documents.Open filePath
wrdApp.Application.ScreenUpdating = true
'make it visible, first
wrdApp.Application.Visible = true
'then maximize
wrdApp.Application.WindowState = wdWindowStateMaximize
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
trasher
September 5th, 2001, 11:52 AM
Thanks!
you were right,
if I make the application visible before I maximize it, the menus are visible..
Make it with rocker style \w/
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.