• WSstephan

    WSstephan

    @wsstephan

    Viewing 15 replies - 16 through 30 (of 51 total)
    Author
    Replies
    • in reply to: Displaying Results within a TextBox (VB 6.0) #1785702

      You’re using the wrong control here to get the job done. Use the listbox and set it to 3 columns instead of the textbox. I think this should make your life a little easier.

      Stephan

    • in reply to: Turning off AutoFormat As You Type (Word 97 SR2) #532099

      Andrew,

      Yes, I agree that Word doesn’t have Activate and Deactivate events like Excel is bad.

      Basically, your only other alternatives would be:

      (1) to put the code to turn the AutoFormatAsYouType options off in the AutoNew and AutoOpen event procedures, and also write code to turn the options back on in the AutoClose procedure. The problem with this approach, however, is if the user works with more than one document at a time, these 3 Word event procedures are useless.

      or

      (2) simply have a button on a toolbar which will enable the user to toggle the settings (without having to go into Tools | AutoCorrect | etc.)

      Sub ToggleAutoFormat()
      With Options
      If .AutoFormatAsYouTypeApplyBulletedLists = True Then
      .AutoFormatAsYouTypeApplyBulletedLists = False
      .AutoFormatApplyBulletedLists = False
      .AutoFormatAsYouTypeApplyNumberedLists = False
      Else
      .AutoFormatAsYouTypeApplyBulletedLists = True
      .AutoFormatApplyBulletedLists = True
      .AutoFormatAsYouTypeApplyNumberedLists = True
      End If
      End With
      End Sub

      Hope that helps.

      Best regards,

      Stephan

    • in reply to: Enter 0 in cell via Macro (Word 97) #531995

      Try this snippet of code. This should do the trick for you:

      Dim aTable As Table
      Dim aCell As Cell
      Dim CellRange As Range

      For Each aTable In ActiveDocument.Tables
      For Each aCell In aTable.Range.Cells
      Set CellRange = aCell.Range
      CellRange.MoveEnd Unit:=wdCharacter, Count:=-1
      ‘Check to see if cell is empty, if so insert a “0”
      If CellRange.Text = “” Then
      CellRange.InsertAfter Text:=”0″
      End If
      Next aCell
      Next aTable

      Best regards,

      Stephan

    • in reply to: Turning off AutoFormat As You Type (Word 97 SR2) #531937

      I propose you simply put the following code somewhere in the AutoExec procedure of your global template:

      With Options
      .AutoFormatAsYouTypeApplyBulletedLists = False
      .AutoFormatApplyBulletedLists = True
      .AutoFormatAsYouTypeApplyNumberedLists = False
      End With

      Best regards,

      Stephan

    • in reply to: Office97 vs. Office2000 #524987

      I would like to thank everyone for their replies here. Your input has been very helpful.

      Stephan

    • in reply to: Update contents of large docuemt #524793

      BAM and kelliel,

      Wow, thanks for setting me straight on this. I had no idea. From now on, I’ll have to remember not to recommend Microsoft Word features that I’ve only used successfully in other products (like WordPerfect). Sorry about that.

      Stephan

    • in reply to: Update contents of large docuemt #524788

      The answer to this sort of thing is to use the master document and subdocuments features in Word.

      Once upon a time, I used the master document and subdocuments features (not in Word, but in WordPerfect for Windows — but the functionality is essentially the same for both) with great success to put together a number of reference books in a publishing company I was working at. Essentially, each chapter in the books would be a separate file. The entire books were the master documents, and within it contained subdocuments — nothing more than references to the files comprising the separate chapters.

      This solves your problem of having someone edit/update individual files and also having the entire book/manual update at the same time.

      And yes, having a Master document/subdocuments setup is definitely conducive to setting up an index — you just have to remember to update the index whenever individual files are changed.

      Stephan

    • in reply to: Transfer AutoText entries between templates? #522548

      Phil,

      Thanks, that’s exactly what I needed to do. Wow, it’s shocking how much Word functionality I don’t know (after years of working with it and programming in it).

      Thanks again.

      Stephan

    • in reply to: AutoText entries in menu #521685

      To Andrew and all:

      Ah, I see what you mean now. That “quick” list of AutoText entries is based on the style of the selection. I didn’t know that.

      A few of my users had insisted that I set up a permanent “quick” list of the most common firm-wide AutoText entries, but now I realize that “quick” list doesn’t work like that.

      Thanks again for enlightening me.

      Stephan

    • in reply to: AutoText entries in menu #521586

      Gary and BAM,

      Thanks for your replies, guys. To make it absolutely clear, what I’m talking about, I’m attaching a file w a screen shot.

      See the list of AutoText entries that appear beneath the “AutoText” and “New” commands? I want to manipulate that.

      Thanks again.

      Stephan

    • in reply to: Word97 Dialogs File Open #521275

      If you want the directory itself, you could just add a line of code just below the .Display line:

      strDirName = CurDir()

      However, for whatever reason, you don’t need the directory name here to open up the user’s selected file. After your chunk of code, if you add the following:

      ‘if user doesn’t dismiss dialog
      If .Display -1 Then
      Documents.Open strFileName
      End If

      This will open up the file chosen by the user. No path is needed in this case. Go figure.

    • in reply to: Updating fields in Multiple Header/Footers #521269

      Good, happy to hear it.

      By the way, do you have a copy of “Learning Word Programming” by Steven Roman (Publisher: O’Reilly)? If you don’t, get it. A lot of the code I gave you here was taken directly from that book.

    • in reply to: Updating fields in Multiple Header/Footers #521243

      Try this:

      ‘******************************************************
      Sub ManipulateAllHeadersFooters()
      Dim aSect As Section

      For Each aSect In ActiveDocument.Sections

      ‘Do your thing to the primary header
      With aSect.Headers(wdHeaderFooterPrimary)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      ‘Repeat for primary footer
      With aSect.Footers(wdHeaderFooterPrimary)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      ‘If first page header/footer exists, then repeat for those too
      If aSect.Headers(wdHeaderFooterFirstPage).Exists Then

      With aSect.Headers(wdHeaderFooterFirstPage)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      With aSect.Footers(wdHeaderFooterFirstPage)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      End If

      ‘Finally, if even page header/footer exists, then repeat for those as well
      If aSect.Headers(wdHeaderFooterEvenPages).Exists Then

      With aSect.Headers(wdHeaderFooterEvenPages)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      With aSect.Footers(wdHeaderFooterEvenPages)
      ‘Perform x…
      NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
      End With

      End If
      Next aSect

      End Sub
      ‘******************************************************

      See what I mean about not having to open each header/footer? Notice all I do in each case is set the range of header/footer (instead of the range of the selection) to be the autotext entry.

      BTW, I gave you some slightly buggy code before, so get rid of the whole thing and use the above.

    • in reply to: Updating fields in Multiple Header/Footers #521217

      That shouldn’t be happening.

      Why don’t you post a small sample of your code.

    • in reply to: Updating fields in Multiple Header/Footers #521034

      Use this as your skeletal code:

      ‘****************************************************
      Sub ManipulateAllHeadersFooters()
      Dim aSect As Section

      For Each aSect In ActiveDocument.Sections

      ‘Do your thing to the primary header
      With aSect.Headers(wdHeaderFooterPrimary)
      ‘Perform x…
      End With

      ‘Repeat for primary footer
      With aSect.Footers(wdHeaderFooterPrimary)
      ‘Perform x…
      End With

      ‘If first page header/footer exists, then repeat for those too
      If aSect.Headers(wdHeaderFooterFirstPage).Exists Then

      With aSect.Headers(wdHeaderFooterPrimary)
      ‘Perform x…
      End With

      With aSect.Footers(wdHeaderFooterPrimary)
      ‘Perform x…
      End With

      End If

      ‘Finally, if even page header/footer exists, then repeat for those as well
      If aSect.Headers(wdHeaderFooterEvenPages).Exists Then

      With aSect.Headers(wdHeaderFooterEvenPages)
      ‘Perform x…
      End With

      With aSect.Footers(wdHeaderFooterEvenPages)
      ‘Perform x…
      End With

      End If
      Next aSect

      End Sub
      ‘****************************************************

      BTW, in this example, you should not think in terms of the code “opening” each header/footer. Instead, think in terms of it simply “acting” on each header/footer object.

    Viewing 15 replies - 16 through 30 (of 51 total)