• WSpieter

    WSpieter

    @wspieter

    Viewing 15 replies - 166 through 180 (of 214 total)
    Author
    Replies
    • in reply to: Sections Page Count (Word 2000) #687143

      hi Kyle,

      the following seems to work for me.

      Function NumberOfPagesInSection _
      ( _
      ByRef CurrentSection As Section _
      ) As Long
      Dim StartSectionPage As Long
      Dim EndSectionPage As Long
      With CurrentSection
      EndSectionPage = _
      .Parent.Range _
      ( _
      .Range.End – 1, _
      .Range.End _
      ).Information(wdActiveEndPageNumber)
      StartSectionPage = _
      .Parent.Range _
      ( _
      .Range.Start, _
      .Range.Start _
      ).Information(wdActiveEndPageNumber)
      End With
      NumberOfPagesInSection = _
      EndSectionPage – StartSectionPage + 1
      End Function

      you can call the function for instance as follows:
      msgbox NumberOfPagesInSection(activedocument.Sections(3))

      greetings,

    • in reply to: Imminent Hard disk failure #682882

      just an update.
      one week ago, the problem just disappeared – no more warnings for over a week now – how smart can smart get!
      it’ll probably come back to stab me in the back i guess.
      i was wondering if standby puts more strain on the hd. since i received the warnings, i have powering down the computer every night in stead of going in standby mode.

      greetings,

    • in reply to: Moving from Page to Page in UserForm (VBA/Wrd/97) #676812

      hi Leigh,

      assuming textbox2 is the last textbox on the first page, the following code will move to the next page with focus on the first control of that page :

      Private Sub TextBox2_KeyDown _
      ( _
      ByVal KeyCode As MSForms.ReturnInteger, _
      ByVal Shift As Integer _
      )
      If KeyCode = 9 Then MultiPage1.Value = 1
      End Sub

      be aware that this will trigger the change event of the multipage, so any code you have placed in that event handler could possibly interfere with the first textbox receiving focus. you could create a userform level boolean variable to prevent any code in the multipage change event from being executed :

      private NoMPChangeEvent as boolean

      Private Sub TextBox2_KeyDown _
      ( _
      ByVal KeyCode As MSForms.ReturnInteger, _
      ByVal Shift As Integer _
      )
      If KeyCode = 9 Then
      NoMPChangeEvent=true
      MultiPage1.Value = 1
      NoMPChangeEvent =false
      end if
      End Sub

      Private Sub MultiPage1_Change()
      if NoMPChangeEvent then exit sub
      ‘rest of your code
      End Sub

      greetings,

    • in reply to: Caller of a DocumentBeforePrint event (Word 2000 SR-1) #670029

      hi Marcel,

      explore the actioncontrol property of the commandbars collection.

      greetings,

    • in reply to: Imminent Hard disk failure #663797

      thanks Bob!

      unfortunately, this won’t work for me as i’m using NTFS on win XP. nevertheless, the grc site is highly recommendable!

      greetings,

    • in reply to: Imminent Hard disk failure #661539

      thanks All for the advice and the links.

      in the mean time i’ve downloaded a diagnostics program from maxtor’s site (powermax) and this seem to indicate the problem is genuine (and not a call from mother dell). there’s a remote chance the more elaborate tests the program provides will succeed in repairing my disk, but i’m just going to wait and see what happens for the moment, since this has no impact for the moment on performance and file storage integrity afaics. (still more than a year of warranty)

      my next ‘puter will definitely be self assembed again, those brand computers are a maintain, upgrade and security nightmare, their performance mediocre at best. ok dell is cheap, i’ll grant em that.

      greetings,

    • in reply to: Templates with 1 Prompt Window (2002/SP2) #661037

      hi,

      please post your code so we can investigate exclamation

      in the mean time i will make a WAG (a crystal ball smilie would be appropriate here) grin

      you can put code either in the document_new event sub of the thisdocumentclass module, with calls to external subs or functions if necessary, or you can put it all in a module (the sub that executes when you start a new document from the template must be called autonew, and be public)

      there is a small problem with userforms. if you start a new document bases on a template for which you previously already created a new document that is still opened, the userform sometimes duplicates the values of the controls that you typed in when you created the first document. this is because when you use the userform1.show method, a hidden global instance of the form is created, which sometimes causes the userform to retain its control values when you leave a previously created document opened. to prevent this, declare a local userform object variable and then instatiate the userform by means of this variable. here’s some small example code to demonstrate (premise : your userform is called ‘Userform1’):

      sub InstantiateLocalisedUserform()
      dim MyLocalUserform as Userform1
      set mylocaluserform=new userform1
      mylocaluserform.caption=”it seems to work now.”
      mylocaluserform.show
      end sub

      ofcourse, you can put this code in the document_new() event sub of the thisdocument class module of the template.

      greetings,

    • in reply to: Disable Track Changes in Word (Word 2000) #661027

      hi Kay,

      protect your document for track changes through the word menu tools->protect document->(track changes)

      greetings,

    • in reply to: Odd Template Save (2002) #659593

      hi Kevin,

      i’m not sure. first see if you have this problem with all templates, if that’s the case then maybe it is indeed word’s installation procedure gone wrong.
      but there are a few things to try first.

      open your template
      examine its fileformat with ?activedocument.saveformat
      is it 0 for a standard document (probably) or is it 1 (template)
      if it’s 1 and it still tries to save as a standard doc, then something might be wrong with word’s installation.
      what do you get if you try this for another template (say one of microsofts standard templates)
      also try to resave it with the following
      activedocument.SaveAs filename:=activedocument.AttachedTemplate.fullname, fileformat:=wdformattemplate
      if nothing else helps, you could try the /regserver switch.

      greetings,

    • hi Hubert,

      word 2002.

      msgbox application.International(wdListSeparator)
      msgbox application.International(wdDecimalSeparator)
      msgbox application.International(wdThousandsSeparator)

      greetings,

    • in reply to: Delete to end of line in Macro (W2K) #659240

      hi,

      without seeing a sample of your document i cannot guarantee 100% this will work, but try this:

      Sub DeleteBadLines()
      Application.ScreenUpdating = False
      Dim BadLine As Long
      With ActiveDocument
      For BadLine = .Paragraphs.Count To 1 Step -1
      If Left(.Paragraphs(BadLine).Range.Text, 1) = “)” Then
      .Paragraphs(BadLine).Range.Delete
      End If
      Next
      End With
      Application.ScreenUpdating = True
      End Sub

      greetings,

    • in reply to: Forcing enable macors to see pages (Word 2000) #658992

      hi,

      this is somewhat cludgy, but it may suit your needs.
      work with two documents.
      1. you protect the actual document with a password on the document level (so they’re prompted for a password when they try to open it directly)
      2. created a second document with a protected VBA project that will act as the loader object. the code simply opens the real passwordprotected document. Now if they open with disabled macros, the document they want will not be loaded – they have to enable macros! ofcourse you inform them of this in your loader document.

      ps. if they have a commercially available passwordcracker to crack the vba password, they’ll see the document password also and gain access that way to the actual document, but i don’t think this should cause any problems in your situation. (this has nothing to do with the question, but as a sidenote : the two document scenario was originally an idea of mine to create a true read only document (yes i still think this is possible) using only word.)

      greetings,

    • in reply to: Easy Word Macro Help (Word 2000) #658672

      or you can put the code that is in your autonew and put it in the Document_New() sub of the thisdocument clas module of the template (see picture)
      have word create the procedure stub for you by unsing the comboboxes on top (doubleclick ThisDocument in the project explorer, choose “Document” in the left drop down combobox and “New” in the right)

      greetings,

    • in reply to: TransferSpreadsheet (2002) #658199

      (No Text)

    • in reply to: Disable Track Changes in Word (Word 2000) #658191

      hi Kyle,

      create a sub with the same name of the word command:

      Sub ToolsRevisionMarksToggle()
      MsgBox “sorry, you cannot toggle the revisionmarks status!”
      End Sub

      here’s the list of interceptable commands : http://www.mvps.org/word/FAQs/General/CommandsList.htm

      greetings,

    Viewing 15 replies - 166 through 180 (of 214 total)