CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2001
    Posts
    60

    no toolbar in word ??

    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/

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: no toolbar in word ??

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Aug 2001
    Posts
    60

    Re: no toolbar in word ??

    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/

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: no toolbar in word ??


    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Aug 2001
    Posts
    60

    Re: no toolbar in word ??

    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 )

    Make it with rocker style \w/

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: early binding


    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: no toolbar in word ??


    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  8. #8
    Join Date
    Aug 2001
    Posts
    60

    Re: early binding

    Thanks!
    you were right,
    if I make the application visible before I maximize it, the menus are visible..

    Make it with rocker style \w/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured