Tuesday, July 10, 2018

Add a border to all images in Word document

To add a border to all images in a Word document, the record a macro feature will not work. Here is the code though that you can add your Microsoft Visual Basic for Applications.
Sub Borders()
' Adds a border of 0.25 width and colored 50% gray to every image in the document.
Dim pic As InlineShape
For Each pic In ActiveDocument.InlineShapes
    pic.Borders.OutsideLineStyle = wdLineStyleSingle
    pic.Borders.OutsideLineWidth = wdLineWidth025pt
    pic.Borders.OutsideColor = wdColorGray50
Next
End Sub

Tuesday, June 12, 2018

Calendar Colored Overlays

Have you ever wanted to color your SharePoint calendars like you can in Outlook colors? Well, you can! It is a rather simple process that Joe Preiner at DEG Digital clearly lays out in his blog post "Four Easy Steps to Customized color Code Calendars in SharePoint."

Mr. Priener does a great job of giving users step-by-step instructions, so I'm simply going to refer you to his website as there is no need for me to further expand on the steps.

Cheers!

Thursday, September 24, 2015

Macro for acronyms in Word 2013

I am by no means a macro expert. My macro skills are rudimentary, much to my own frustration. However, I recently spent some time to develop a macro to automatically create an acronyms list in Word 2013, which I've been wanting to do for a long time.

First the basic steps to get started.

  1. As you come across a defined acronym in your document, highlight the definition and acronym. (In the tech writing world, we define acronyms the first time utilizing this format: "Common Configuration Enumerations (CCE)." For this macro, you'll highlight everything that's similar to the text in quotes.)
  2. Click the References tab on the menu, and click Mark Entry in the Index group.
  3. Leave the defaults in the form box and click Mark.
  4. Once you've marked all the acronyms, place your cursor where you want the acronyms list.
  5. Click the References tab, and click Insert Index.
  6. On the form box, leave the defaults, but ensure the "Columns" option is set to "Auto."
  7. Select the entire index Word just inserted.
  8. Run the macro.
Need help adding a macro? Reference this site





Sub ChangeIndextoAcronymList()

' Converts selected field to static text

    Selection.Fields.Unlink

'Replaces blank Index Heading lines.

  Selection.Find.ClearFormatting
    Selection.Find.Style = ActiveDocument.Styles("Index Heading")
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindFalse
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    
    Selection.Find.Execute Replace:=wdReplaceAll
    
' Finds the left parenthesis and replaces it with a tab.

 Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "("
        .Replacement.Text = "^t"
        .Forward = True
        .Wrap = wdFindFalse
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Application.DisplayAlerts = False
    Selection.Find.Execute Replace:=wdReplaceAll
    

' Finds the right parenthesis and tab in the selection and replaces
' it with one tab.

  Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ")^t"
        .Replacement.Text = "^t"
        .Forward = True
        .Wrap = wdFindFalse
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' Finds the right parenthesis and comma in the selection and replaces
' it with one tab.

  Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "),"
        .Replacement.Text = "^t"
        .Forward = True
        .Wrap = wdFindFalse
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll


'Converts the selected text to a table with unset number of rows.

    Selection.ConvertToTable Separator:=wdSeparateByTabs, NumColumns:=3, _
        AutoFitBehavior:=wdAutoFitFixed
        
' Insert a row at the top of the table
   Selection.Tables(1).Select
   Selection.InsertRowsAbove 1

' Add Text to cell 1,1 in table and type text
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.TypeText Text:="Acronym"
    Selection.MoveRight Unit:=wdCell
    Selection.TypeText Text:="Definition"
    Selection.MoveRight Unit:=wdCell

'Apply Table_1 style to the table

    With Selection.Tables(1)
        .Style = "Table_1"
        .ApplyStyleHeadingRows = True
        .ApplyStyleLastRow = False
        .ApplyStyleFirstColumn = False
        .ApplyStyleLastColumn = False
    End With

'Delete third column of selected table

    Selection.Tables(1).Select
    With Selection
        .Columns(3).Delete
    End With

'Cut and paste second column

    Selection.Tables(1).Select
    
    With Selection
        .Columns(2).Select
        .Cut
        .PasteAndFormat (wdPasteDefault)
    End With

' Sort table by first column

    Selection.Tables(1).Select
    Selection.Sort ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
        :=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending

'Apply Table_Text style to the table and auto fits the table

    Selection.Style = ActiveDocument.Styles("Table_Text")
    Selection.Tables(1).AllowAutoFit = True
    Selection.Tables(1).AutoFitBehavior wdAutoFitContent
    Selection.Tables(1).Cell(1, 1).Range.Select
    Selection.Tables(1).AutoFitBehavior wdAutoFitWindow

Tuesday, August 25, 2015

Trouble viewing PDFs in Chrome? Here is the solution.


I’ve recently had issues viewing PDFs in Chrome and thought it was something only I was experiencing. However, at a meeting today, I noticed another co-worker was having the same issue.  I thought I should share the quick solution.

 

Starting in Chrome 42, NPAPI plugins like Adobe Reader have begun the final phase of removal, and will no longer work be shown in the chrome://plugins page. Therefore, Google recommends that users ensure the built-in “Chrome PDF Viewer” is enabled on their browser.

Follow these steps to ensure the plugin is enabled:
  1. Type chrome://plugins in Chrome address bar and press Enter.
  2. Scroll down to Chrome PDF Viewer.
  3. Enable Type: BROWSER PLUGIN  and PPAPI if currently disabled.
    1. In this image, the BROWSER PLUGIN and PPAPI are currently enabled.
    2. If you want PDFs to open in the default program (e.g., Adobe Acrobat or Reader), disable the BROWSER PLUGIN type by clicking Disable.
  4. Disable any other PDF Viewer plugins (there will probably not be any others, though).
NOTE: If you choose to open PDFs in the default program (step 3.c.), you can stop here. If you want to open PDFs in the browser still, continue on. 
Open a PDF link in Chrome to see if the issue is fixed. However, following the steps above, did not fix the issue for me. Instead, I needed to add an extension.
  1. Click this link (or copy and paste this link into Chrome) to open the extension pdf.js page: https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm?hl=en-US.
  2. Click the ADD TO CHROME button in the upper right corner of the window.
Additionally, I needed to disable an extension. 
  1. In Chrome, click the hamburger icon and click Settings.
  2. Click Extensions, and uncheck the Enabled box for Adobe Acrobat – Create PDF (or other Adobe extensions).

You should now be able to open PDFs in Chrome. 
I hope this helps! Cheers!