• richardbarrett

    richardbarrett

    @wsrichardbarrett

    Viewing 15 replies - 31 through 45 (of 704 total)
    Author
    Replies
    • in reply to: Word – Quick Style Gallery #1584772

      Thank you very much.
      Richard

    • in reply to: Word Macro to insert a file #1573835

      If you want to assign the current selection to a variable, use Selection.Value.

    • in reply to: Word Macro to insert a file #1573833

      So it’s not the image you’re cutting and pasting — it’s the filename. Assign the file name to a variable (you haven’t supplied that part of the code), and then use the variable as the picture name. In the above code, where did you get “c:projectpicturesmypict1.jpg”?

    • in reply to: Word Macro to insert a file #1573829

      Try: Selection.Paste

    • I thought that Grammarly sounded interesting, so I downloaded the install file. A while later, I got an email informing me of the “plans”. They range from about $12 a month (paid annually) to $30 a month (paid monthly).

    • in reply to: SQL Server Developers Edition #1573351

      Thanks to both of you for that information.
      Richard

    • in reply to: Excel 2016 Publish to Power bl #1573088

      Thank you…. this is helpful. I tried writing RibbonX code to hide this task, and Excel ignores it. Must be modern authentication is the only thing that affects it.

      Novogazztrian?

      Richard

    • in reply to: Add-Ins strange behavior #1572982

      There is a recent security update to Office that can cause this. You need to locate the add-in file in explorer, right-click it and then unblock it.

      Would you please explain what is meant by “unblock”?

      Thanks.

    • in reply to: macro to position cusor using “find” #1559577

      This is a simple way to achieve this:

      Code:
      Sub gtg()
          Dim x As Long
          
      again:
          Selection.Find.ClearFormatting
          With Selection.Find
              .Text = “gtg”
              .Forward = True
          End With
          Selection.Find.Execute
          Selection.Delete
          Selection.MoveLeft Unit:=wdCharacter, Count:=1
          Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
          Selection.Cut
          Selection.HomeKey Unit:=wdLine
          Selection.Paste
          Selection.TypeText Text:=” ”
          x = Selection.movedown(Unit:=wdLine, Count:=1)
          If x = 0 Then
              Exit Sub
          End If
          GoTo again:
      
      End Sub
      
    • Then using the code I sent previously, apply the style instead of the highlight. Of course you’ll want to be sure that QuestionStyle (or whatever style name you use) exists in the document, otherwise you’ll get an error. You can trap the error with code, but if you’re the sole user, you might not need to.

      Code:
      Sub selectQuestions()
          Dim rng As Range
          Dim s As Range
          For Each s In ActiveDocument.Sentences
              Set rng = s
              rng.MoveEnd wdCharacter, -1
              If rng.Characters.Last = “?” Then
                  rng.Style = “QuestionStyle”
              End If
          Next
      End Sub
    • What is it that you want to do with the selected blocks of text? VBA simply cannot select multiple contiguous blocks of text. Have a look at the following MS knowledge base article:

      https://support.microsoft.com/en-us/kb/288424

    • Although selecting non-contiguous text is offered by Word when working interactively, it is not possible to do this with VBA. You can highlight (or apply some other distinctive attribute) to the questions, and then process your highlighted chunks of test.

      Code:
      Sub selectQuestions()
          Dim rng As Range
          Dim s As Range
          For Each s In ActiveDocument.Sentences
              Set rng = s
              rng.MoveEnd wdCharacter, -1
              If rng.Characters.Last = “?” Then
                  rng.HighlightColorIndex = wdBlue
              End If
          Next
      End Sub
    • in reply to: Win10/Office2016 Startup #1543993

      OfficeNNStartup was for a long time the default Startup folder. Some of the folks I work with resist change (sometimes with good reason) and continue to use that. It’s a single location on a PC and doesn’t require delivery of startup templates to each user’s profile. I understand the desire for easy distribution, but each version of Windows/Office has made it a bit less satisfactory (for security reasons, of course). For example, on a Citrix server where a number of users share the C: drive, admin folks prefer this Startup folder. It’s usually a level below the folder where WinWord.exe is located. VBA’s Application.Path returns that folder, and it’s easy to add subfolder Startup. Sometimes this folder is user for universal startup templates, and practice group startup templates are delivered to the roaming profile startup folders for specific PG members.

    • in reply to: Word 2016 Run as Administrator #1535893

      Noted. But it does not appear when I right-click the Word icon on the Start menu. In any case, that is not the point. I’m asking what the option does… what is the advantage, if there is one?

      42518-Word-Right-Click

    • in reply to: Word 2016 Run as Administrator #1535857

      I right-clicked on the Word tile because I want to add it to the taskbar. The option does not appear with Word 2010, it does appear with Word 2013 and 2016. I’m wondering that the advantage is, other than relating to updates (which I found by Googling).

    Viewing 15 replies - 31 through 45 (of 704 total)