Find Backup Folder Data Location Using GetSpecialLocation in MS OneNote 2010 in VB.NET

In this article i am going to explain about GetSpecialLocation method. you will find How to Find Backup Folder Data Location Using GetSpecialLocation in MS OneNote 2010.
  • 2487

Introduction

In this article, I am going to explain how to use GetSpecialLocation method in your program. This method is helpful for us when we try to know about what is the location of the backups folder, automatic and manual backups of your OneNote files. It also provide information about default location of local files for new notebooks. 

Microsoft Office 2010 offer some powerful tools, using this tools you can create application. Using Microsoft Visual Basic for Applications (VBA) you can create your own application according to your need. These application can performer some specific task.

For creating application we can use

  • VBA host of Excel 2010
  • VBA host of PowerPoint 2010
  • VBA host of Word 2010

NOTE : OneNote 2010 is not a VBA host.

In this application you have to add Microsoft OneNote 14.0 Object Library reference from external references libraries using the Add References dialog.

Code that we use in this application are given below

Sub GetSpecialLocationData()

    ' Connect to OneNote 2010.
     ' OneNote starts if it's not running.

    Dim vip As OneNote14.Application
    vip = 
New OneNote14.Application 

    Dim vipbf As String
    Dim vipdnf As String
    Dim vipuns As String 

    vip.GetSpecialLocation(slBackUpFolder, vipbf)
    vip.GetSpecialLocation(slDefaultNotebookFolder, vipdnf)
    vip.GetSpecialLocation(slUnfiledNotesSection, vipuns)

     Dim msg As String

    msg = "OneNote 2010 Special Locations are: " & vbCrLf & _
        
"Backup: " & vbCrLf & "  " & vipbf & vbCrLf & _
        
"Default Notebook: " & vbCrLf & "  " & vipdnf & vbCrLf & _
        
"Unfiled Notes: " & vbCrLf & "  " & vipuns

     MsgBox(msg, vbInformation, "GetSpecialLocation")

End Sub

Step for creating application 

Step 1 : Start MS Word 2010:

Clipboard02.jpg
 

Clipboard03.jpg
 

Step 2 : Using ALT + F11 key start Visual Basic for Applications (VBA) window:

Clipboard04.jpg

Step 3 : Select on This document and Right click on it and select View code:

Clipboard043.jpg

Step 4 : Add Microsoft OneNote 14.0 Object Library reference from external references libraries using the Add References dialog:

Clipboard04 (5.jpg
 

Clipboard7.jpg
 

Step 5 : Write Code in Visual Basic for Applications (VBA) window:

Clipboard081.jpg
 

Step 6 : Run the application using F5:

Clipboard082.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.