• WSStuartR

    WSStuartR

    @wsstuartr

    Viewing 15 replies - 9,466 through 9,480 (of 9,497 total)
    Author
    Replies
    • in reply to: Status Bar Variables (97+) #558454

      > I assume your 2nd item should have had Line in it.
      It does now smile

      This seems to work for me…

         
          Dim line_position, col_position As Integer
          Dim at_position As Single
          Dim bPagination As Boolean ' Previous state of pagination
          Dim iView As Integer ' Previous view type
         
             ' Disable background pagination to get line numbers
             bPagination = Options.Pagination
             If Not bPagination Then Options.Pagination = True
         
             ' Make sure we are in print layout view to get At and Line number
             If ActiveWindow.View.SplitSpecial = wdPaneNone Then
                 iView = ActiveWindow.ActivePane.View.Type
                 ActiveWindow.ActivePane.View.Type = wdPrintView
             Else
                 iView = ActiveWindow.View.Type
                 ActiveWindow.View.Type = wdPrintView
             End If
             
             at_position = Selection.Information(wdVerticalPositionRelativeToPage)
            ' Convert to centimeters with one decimal point
             at_position = Round(PointsToCentimeters(at_position), 1)
            
             line_position = Selection.Information(wdFirstCharacterLineNumber)
             col_position = Selection.Information(wdFirstCharacterColumnNumber)
             
             ' Reset view and pagination to original values
             Options.Pagination = bPagination
             
             If ActiveWindow.View.SplitSpecial = wdPaneNone Then
                 ActiveWindow.ActivePane.View.Type = iView
             Else
                 ActiveWindow.View.Type = iView
             End If
         
             MsgBox "At:  " & at_position & "cm" & vbCrLf & _
                    "Ln:  " & line_position & vbCrLf & _
                    "Col: " & col_position
         
      

      StuartR

    • in reply to: Status Bar Variables (97+) #558450

      Look at the help for Selection.Information( )

      Things you might need are

      wdFirstCharacterColumnNumber for the column number
      wdFirstCharacterLineNumber for the line number, but will give you -1 if background pagination is on
      wdActiveEndPageNumber for the page number of the end of the selection

      StuartR

    • in reply to: Status Bar Variables (97+) #558413

      I’ve often written to it with simple commands like

      Statusbar = “text”

      I assumed that you could access the contents with a similar command, but according to the Help file for Word 2000, it is write only.

      StuartR

    • in reply to: Linking to a Visio Drawing Page (Word 2K/SR1 & Visio 2K/SR1) #558387

      I couldn’t get it to display the link – I had to figure it out from the Edit-Links menu.

      StuartR

    • in reply to: Resizing a shape to make a pie chart (XP) #558196

      This same question is also posted on the Excel board, I have replied to it here.

      StuartR

    • in reply to: Resizing a shape to make a pie chart (XP) (XP) #558149

      If your shape is the one I think it is then the following code will work…

          Const MyFilename = _
      "C:Program FilesCommon FilesMicrosoft SharedClipartautoshapBD18235_.WMF"
      
          Set MyShape = Worksheets(1).Shapes.AddPicture(MyFilename, True, True, 100, 100, 70, 70)
          
          With MyShape
              .Adjustments.Item(1) = 30    ' Angle of start handle
              .Adjustments.Item(2) = 120 ' Angle of end handle
              .Rotation = 0#
          End With
      
      

      StuartR

    • in reply to: Linking to a Visio Drawing Page (Word 2K/SR1 & Visio 2K/SR1) #558143

      That worked. The link it inserted was (after a bit of manual editing ‘cos Alt-F9 wouldn’t display it)

      { LINK Visio.Drawing.6 serversharefolderfilename.VSD Drawing~page2 }

      StuartR

    • in reply to: Linking to a Visio Drawing Page (Word 2K/SR1 & Visio 2K/SR1) #557776

      Stupid misunderstanding on my part, I was talking about the syntax of a Hyperlink, not a Word link field.

      StuartR

    • in reply to: Blank lines between paragraphs (VBA – Word 2000) #557606

      My Macros always break because of some condition I never thought to check for, it’s not like writing in a “real” language where everything is usually fairly well defined.

      Try adding

          if myRange.Information(wdWithInTable) Then 
      or
          If myRange.Information(wdAtEndOfRowMarker) Then
      

      Depending on whether you want to skip every paragraph inside a table, or just the one at the end of a row. I haven’t tested either of these but you should get the idea.

      StuartR

    • in reply to: Blank lines between paragraphs (VBA – Word 2000) #557599

      You want something like

      Dim myRange As Range
      Set myRange = ActiveDocument.Paragraphs(1).Range
          Do While myRange.End < ActiveDocument.Content.End - 1
              If myRange.ParagraphFormat.Style = "Normal" Then
                  myRange.InsertAfter vbCrLf
                  myRange.Move unit:=wdParagraph
              End If
              myRange.Move unit:=wdParagraph
          Loop
      

      StuartR

    • in reply to: Linking to a Visio Drawing Page (Word 2K/SR1 & Visio 2K/SR1) #557557

      ServernameSharenameFoldernamefilename.vsd#page2 seems to work fine.

      StuartR

    • in reply to: Problem Opening Attached Excel File In Outlook (2000) #557059

      When I do this on my system running
      Windows 98 SE
      Office 2000 SR1a
      I note that the temporary file is saved in a sub-folder of my Temporary Internet Files folder.

      I have occassionally seen strange problems on various PCs which have very large numbers of files in Temporary Internet Fiels. How about clearing your temporary internet files from within Internet Explorer to see if this helps?

      StuartR

    • in reply to: Internationalize Excel VBA (Excel 97 and 2000) #556819

      The one that always breaks my VBA code is Right-to-Left languages. If you’re going to be shipping your code to a world wide audience then you need to test using using one of these.

      StuartR

    • in reply to: Move Pages (Any) #556743

      If you’re looking for an interactive solution then

      Select the text you want to move
      Press the F2 key
      Move the insertion point to the destination
      Press enter

      StuartR

      PS Can anyone tell me why the /PRE tag in my previous post didn’t work?

    • in reply to: Move Pages (Any) #556742

      I assume you are looking for a VBA solution, and not an alternative to dragging and dropping in Word. You could try Wordbasic.Movetext, according to the helpfile there is no equivalent VBA command.

      The syntax is a bit tricky, something like

        ' select the text you want to move
      Wordbasic.Movetext
        ' move the selection point to the destination location
      Wordbasic.OK
      
      
      

      StuartR

    Viewing 15 replies - 9,466 through 9,480 (of 9,497 total)