Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Application.Visible for Microsoft Graph (Word 97)

    I'm using VB commands to insert a chart into a Word document (WordBasic.InsertChart).

    However, when running the application, the creation and insertion of the chart is shown to the user. Ideally, I'd like to turn the display for Microsoft Graph off during this process. I've searched Word and Visual Basic help as well as the Internet and thus far am no closer to a solution.

    Can someone please point me in the right direction on how to do this?

    NOTE: Application.Visible = False only turns off the display for the Word document, not for Microsoft Graph.

    TIA.

    TexasTJ

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Application.Visible for Microsoft Graph (Word 97)

    TexasTJ,

    Would you be willing to post a relevant chunk of the code?

    Gary

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application.Visible for Microsoft Graph (Word 97)

    Gary,

    The relevant area of code is below. Basically, in the code I'm selecting a table (3 rows x 4 columns) and adding a bar chart to the document based on the selected table. What I want to avoid is Microsoft Graph being visible during the creation of the chart. (I'm concerned the users will not like it and/or be confused by it.)

    Any help would be appreciated.

    TIA

    TexasTJ

    'Insert Chart based on premium table
    Selection.GoTo What:=wdGoToBookmark, Name:="PremiumTable"
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = True
    End With

    WordBasic.InsertChart
    Selection.ShapeRange.Fill.Visible = msoFalse
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoFalse
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Height = 170
    Selection.ShapeRange.Width = 432#
    Selection.ShapeRange.PictureFormat.Brightness = 0.5
    Selection.ShapeRange.PictureFormat.Contrast = 0.5
    Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic
    Selection.ShapeRange.PictureFormat.CropLeft = 0#
    Selection.ShapeRange.PictureFormat.CropRight = 0#
    Selection.ShapeRange.PictureFormat.CropTop = 0#
    Selection.ShapeRange.PictureFormat.CropBottom = 0#
    Selection.ShapeRange.RelativeHorizontalPosition = _
    wdRelativeHorizontalPositionColumn
    Selection.ShapeRange.RelativeVerticalPosition = _
    wdRelativeVerticalPositionPage
    Selection.ShapeRange.Left = InchesToPoints(0.2)
    Selection.ShapeRange.Top = InchesToPoints(2.61)
    Selection.ShapeRange.LockAnchor = False
    Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom
    Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
    Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
    Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
    ActiveWindow.ActivePane.SmallScroll Down:=8

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Application.Visible for Microsoft Graph (Word 97)

    How about putting
    <pre>Application.ScreenUpdating = False
    </pre>

    before your code and
    <pre>Application.ScreenUpdating = True
    </pre>

    at the end?

    StuartR

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Application.Visible for Microsoft Graph (Word 97)

    TJ,

    I don't have Word 97 to play with anymore, but try putting this line:

    ActiveDocument.ActiveWindow.WindowState = wdWindowStateMinimize

    at the beginning of your code, and the following line:

    ActiveDocument.ActiveWindow.WindowState = wdWindowStateMaximize

    at the end of your code, and see if that makes any difference.

    Gary

  6. #6
    Star Lounger
    Join Date
    Apr 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application.Visible for Microsoft Graph (Word 97)

    Thanks for the suggestions.

    I tried both - unfortunately without any luck.

    At the time the graph appears/displays on the screen, the system shows the Word document the graph is inserted into as the active window/document (not Microsoft Graph). Microsoft Graph does indicate as being open/running task, but I've still not been able to make it invisible/hide during the process of inserting the graph.

    Any other thoughts/ideas/suggestions?

    TIA

    TexasTJ

Posting Permissions

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