• WSjweissmn1

    WSjweissmn1

    @wsjweissmn1

    Viewing 15 replies - 46 through 60 (of 82 total)
    Author
    Replies
    • I don’t know how to set that focus – there is little information available on how to manipulate task panes through VBA.

      But if you prefer the old style find, which is now called Advanced Find, here is an article that includes instructions on how to jigger Word so you can get to it easily:

      http://www.techandlife.com/2010/07/the-new-search-feature-ctrl-f-in-word-2010/

      – Jessica

    • Have you checked to make sure the language for your text is not set to ignore spell check?

      Select all your text, and use the Set Language option (I don’t know where it is in 2010, but it is one of the buttons on the right hand side of the Proofing tab in 2007). Clear the Do not check spelling or grammar checkbox and click OK.

      – Jessica

    • Are you saying that the entire page shows a grey background?

      If so, check what your Normal style is set to in the template, or your character/font default.

      If you’re changing the Normal style in a single doc and have Word set to update styles from the template, you’re overwriting the change each time.

      – Jessica

    • in reply to: Word 2010 Crashes in Footnotes #1331935

      What error message do you get, if any?

      What is the goal of your macro?

      What happens if you go step by step and trace execution? Anything interesting happening to any of the variables?

      If the crashes are truly random, I would suspect that some memory buffer is filling up.

    • in reply to: Finding Direct Formated Styles #1330577

      Sure. You could replace the line that creates the comment with lines that reset the paragraph and character formatting, if you’re feeling brave and don’t want to approve each change.

      Replace this:

      If sCommentText “” Then
      .Comments.Add p.Range, sCommentText
      End If

      with something like this:

      If sCommentText “” Then
      .Comments.Add p.Range, sCommentText
      else

      p.Range.ParagraphFormat.Reset
      p.Range.Font.Reset

      End If

    • in reply to: Automatic cross referencing in a large document #1330528

      What about using document.getCrossReferenceItems to get an array of the numbered clauses, then loop through all the numbered clauses, search for any text matching the clause number elsewhere in the doc, and use selection.insertcrossreference to replace the text with a cross-ref to the numbered clause (with options set for showing the number only)?

      Not trivial but a macro jockey with time on his or her hands could do it. I wish I had the time to play with this.

      Oh, and for the future you might want to bribe whoever creates the documents to insert the clause references as automated cross-refs to begin with.

      – Jessica

    • in reply to: Automatic cross referencing in a large document #1330523

      Ok. You’re definitely in macro-land. I think I can see how to do it. You would use document.getCrossReferenceItems to get an array of the numbered clauses, then loop through all the numbered clauses, search for any text matching the clause number elsewhere in the doc, and use selection.insertcrossreference to replace the text with a cross-ref to the numbered clause.

      Not trivial but a macro jockey with time on his or her hands could do it. I wish I had the time to play with this.

      Oh, and for the future you might want to bribe whoever creates the documents to insert the clause references as automated cross-refs to begin with.

      – Jessica

    • To save your doc as a template, do a Save As and select the .dotm format (macro-enabled template).

      There are lots of interesting things you can do with fields and dates, including date calculations.

      Is there some reason why you don’t just want to enter the date manually in the document? Knowing the reason will make it easier to help you figure out a solution.

      – Jessica

    • in reply to: Finding Direct Formated Styles #1330442

      You would have to go through each paragraph and compare the actual formatting of the paragraph to the base format. Here is something that sort of does it. I can’t remember where I got, and I may even have either written or tweaked it myself, though I doubt it. It compares specific aspects of the paragraph’s actual format to the formatting in the basic paragraph style. It adds comments on the non-conforming paragraphs. You could do something else to them, of course.

      Sub DetectDirectFormatting()
      Dim p As Paragraph
      Dim sCommentText As String
      Dim sStyle As String

      With ActiveDocument
      For Each p In .Paragraphs
      ‘ line below ignores those end of table row things that are strange

      If Not IsParaEndOfRow(p) Then
      sCommentText = “”
      sStyle = p.Style
      If p.Range.ParagraphFormat.Alignment .Styles(sStyle).ParagraphFormat.Alignment Then
      sCommentText = sCommentText & “Alignment. ”
      End If
      If p.Range.Bold .Styles(sStyle).Font.Bold Then
      sCommentText = sCommentText & “Bold. ”
      End If
      If p.Range.Italic .Styles(sStyle).Font.Italic Then
      sCommentText = sCommentText & “italic. ”
      End If
      If p.Range.Font.Name .Styles(sStyle).Font.Name Then
      sCommentText = sCommentText & “Font. ”
      End If
      If p.Range.ParagraphFormat.LineSpacing .Styles(sStyle).ParagraphFormat.LineSpacing Then
      sCommentText = sCommentText & “Line Spacing. ”
      End If
      If p.Range.ParagraphFormat.SpaceAfter .Styles(sStyle).ParagraphFormat.SpaceAfter Then
      sCommentText = sCommentText & “Space After. ”
      End If

      If p.Range.ParagraphFormat.LeftIndent .Styles(sStyle).ParagraphFormat.LeftIndent Then
      sCommentText = sCommentText & “Left Indent. ”
      End If
      If p.Range.ParagraphFormat.OutlineLevel .Styles(sStyle).ParagraphFormat.OutlineLevel Then
      sCommentText = sCommentText & “outline level. ”
      End If
      ‘ Additional items here
      ‘If p.Range.ListFormat.ListTemplate .Styles(sStyle).ListTemplate Then
      ‘sCommentText = sCommentText & ” listTemplate ”
      ‘End If

      If sCommentText “” Then
      .Comments.Add p.Range, sCommentText
      End If

      End If
      Next p
      End With
      End Sub

    • in reply to: Automatic cross referencing in a large document #1330385

      Are the original paragraphs you want the cross-reference to lead to created using Word’s outline numbering? And by “cross-reference” do you mean making the text hyperlink?

      If so, when you enter the text that refers to clause 2(a)(i) you can do it by entering it as a cross-reference to the original location. In the Enter cross-reference box, select Numbered Items and Paragraph Number.

      If you are faced with a doc where someone hand-entered all the references originally, you’re in macro-land. It wouldn’t be a simple macro, either.

      – Jessica

    • in reply to: Finding Direct Formated Styles #1330383

      ….turn off Keep Track of Formatting in the options. Then you will see only actual styles in the list.

      – Jessica

    • in reply to: How to insert paragraph before table #1322908

      Thanks for pointing out SplitTable. I don’t know how I missed that in the docs.

    • in reply to: How to insert paragraph before table #1321723

      I started playing with this in Word 2007 (which is what I have). If the table is the first thing in the header, you get the results you mentioned. I couldn’t put anything above the table either manually or with an ordinary macro.

      So I tried something more elaborate. Put a carriage return AFTER the table, and select both the table and the paragraph mark. Then run this code:

      Sub insertbefore()

      ‘ Works ONLY if you select the table AND the paragraph mark after it


      Selection.Copy
      Selection.Delete

      Selection.insertbefore (“dsfsd”)
      Selection.Collapse direction:=wdCollapseEnd
      Selection.Paste
      End Sub

      You end up with an extra paragraph mark after the table (total of two), and of course you will probably insert something other than “dsfsd”

      I leave it to you to put in and delete the extra paragraph marks.

      – Jessica

    • in reply to: Number of pages should count only the body of the doc #1318430

      Thanks – I already have the numbering set up differently for the front sections, and am familiar with the various options.

      And yes, Gary, I meant SectionPages

      Mr. Kenyon’s solution will work beautifully if I don’t have appendices after the end of the document body and if the front matter is in a single section. But I can probably figure out something based on the technique. My authors like to number appendices in the A-1, B-1 style. So I can probably put white-font SectionPages fields into bookmarks for each appendix, and subtract those values from NumPages along with the front matter SectionPages value or values.

      I’ll also see if they want to count the unnumbered pages at the start of some sections.

      Thanks for the ideas.

    • in reply to: VBA to set “Move object with text” #1310819

      Try it with ShapeRange, not Shape.

    Viewing 15 replies - 46 through 60 (of 82 total)