Blog Archives

How to export multiple pages from OneNote to a single Word document

I needed to find a way to export a number of pages from a OneNote notebook into Word documents. The technique I used and will step through in this post was to:

  • Create a new OneNote section (temporarily in needed) to arrange the pages I wanted to export (one section per Word document I wanted)
  • Export the entire section into a Word (*.docx) file
  • Automatically fix up image sizing issues with a custom macro

image

Right-click on the section tab and select Export…

image

Change the export file type to be a Word document (*.docx)

image

This will export all pages from the OneNote section and append them all into one Word document. This is a pretty good result except for the pictures. In many cases the pictures are wider than the page width and look half missing.

image

The solution to quickly and easily address the image width problem in bulk is to create a Word macro to resize all images in a Word document that are too wide to fit on the page.

Here’s how we create the Word macro (this is in Outlook 2016)

The Developer toolbar needed for creating macros isn’t visible by default so to switch it on to File | Options | Customize Ribbon and ensure Developer is checked

image

You should now get the Developer toolbar appearing

image

Select Macros, give the new macro a name and select a scope for where to save the macro (this determines where it will be available later on).

image

You will now be dropped into the VB Macro Editor experience which looks nothing like Word! Don’t worry you just need to paste the following code in as shown

image

Here’s the macro code to copy/paste

Dim i As Long
With ActiveDocument
For i = 1 To .InlineShapes.Count
If PointsToCentimeters(.InlineShapes(i).Width) > 15 Then
With .InlineShapes(i)
.LockAspectRatio = msoTrue
.Width = CentimetersToPoints(15)
End With
End If
Next i
End With

The result should look like this, you can then save and close the macro editor window

image

Now back in Word, with your document open (with the oversized images) select Developer | Macros, select your new macro and click Run

image

Once the macro has completed all the images that were over 15cm in width will have been resized to fit on the page.

This assumes the pages are in portrait orientation and that the maximum width of an image should be 15cm

image

How to Export SharePoint 2010 External Content Types (BDC Metadata Models) to Xml File

External content types are defined through XML files referred to as “BDC metadata models”. These BDC metadata models can be created in both SharePoint Designer and Visual Studio. The technique used to create the BDC metadata models determines the technique used to export it.

  • Models created using Visual Studio can be exported directly through the SharePoint UI in a browser (via the BDC service application).
  • Models created using SharePoint Designer must be exported using SharePoint Designer

 

How to Export BDC Metadata Model using the BDC Service Application

Open SharePoint Central Administration | Application Management | Manage Service Applications

image

Select the Business Data Connectivity Service

image

Change the view drop-down to BDC Models

image

From the context menu on the BDC Model choose Export BDC Model

image

Ensure the file type is set to Model to Export

image

Select the save location. The exported file is an xml file saved with a .bdcm file extension (Visual Studio SharePoint BDC Designer File)

image

 

How to Export BDC Metadata Model using SharePoint Designer

Open the SharePoint site in SharePoint Designer and select External Content Types

bcs-01-export-bdc-metadata-model-using-sharepoint-designer

Select the External Content Type and choose the Export BDC Model ribbon button

bcs-02-export-external-content-type

Provide a name for the exported model and the settings profile to export.

image

The settings refer to the Default and Client settings profiles under on the Connection Properties.

bcs-03-export-bdc-model-settings-default-client

Select save location. The exported file is an xml file saved with a .bdcm file extension (Visual Studio SharePoint BDC Designer File)

bcs-04-export-bdc-model-save-bdcm-file

%d bloggers like this: