Outlook add-in plugin .Net development experience - Supplement (2.1)

zhaozj2021-02-16  44

The number of orders this file here is too small, only multiple times.

1. Create menu, button in Outlook.

Create Menu, Button in Outlook.

Private m_omainmenu as office.commandbarpopup

Private Withevents Mnuloginoff as Office.commandbarbutton

Dim Obars as office.commandbars

Dim Omenubar as office.commandbar

'Add and select Toolbar

Obars = m_olexplorer.commandbars' Take all menu bar

Omenubar = Obars.ActiveMenuBar 'takes the current menu bar

'Add main menu

m_omainmenu = ctype (Omenubar.controls.Add (10,,,, True), Office.comMandBarpopup)

m_omainmenu.caption = "mainmenu"

'Add a menu item

Mnuloginoff = ctype (m_omainmenu.controls.add (type: = 1), office.commandbarbutton) ', Temporary: = true, before: = 1)

Mnuloginoff.caption = "mnuloginoff"

Mnuloginoff.enabled = true

2. Create, modify the folder view.

Create, modify Folder View.

Folder View is an XML format.

Dim MyView as myoutlook.view

Dim myviews as myoutlook.views

Myviews = g_obasefolder.views

MyView = myviews.add (name: = "

Normal

View ", _ viewType: = myoutlook.olviewtype.oltableview, saveoption: = myoutlook.olviewsaveOption.olviewsaveOptionAllFoldersOfType

MyView.xml = sviewXML

MyView.save ()

3. Modify the category category.

Category information, stored in the registry.

'****************************************

'Increase, modify category, debug

'****************************************

Private sub mnudebug2_click (byval ctrl as microsoft.office.core.commandbutton, byref canceldefault as boolean) Handles Mnudebug2.click

DIM SSUBKEY AS STRING

Dim Svaluename As String

Dim Ovalue as Object

SSUBKEY = "Software / Microsoft / Office / 10.0 / Outlook / Categories"

svaluename = "masterlist"

Ovalue = getRegisterValue (SSUBKKEY, SVALUENAME, MODOUTLOK.REGTYPEENUM.REGBINARYTYPE) DIM SOLDCATEGORIES AS STRING

Soldcategories = getRegisterValue (SSUBKEY, SVALUENAME, MODOUTLOOK.REGTYPEENUM.REGBINARYTYPE)

DIM SNEWCATEGORIES AS STRING

Snewcategories = InputBox ("Please Input New Categories, Use; Split", "Input", Soldcategories)

'snewcategories = "Custom; VIP; policy; waiting; telephone; personal; supplier; point of view; international; greeting card; holiday; competition; gift; target / purpose; business; time and funding; favorite; mature; miscellaneous

SNewcategories = Trim (SNewcategories)

IF Right (SNewcategories, 1) = ";" THEN

SNewcategories = Trim (Left (SNewcategories, SNewcategories.length - 1))

END IF

Ovalue = EncodeChineseSSSTRING2UNICODE (SNEWCATEGORIES)

SetRegisterValue (SSUBKEY, SVALUENAME, OVALUE)

MsgBox (SNewcategories, MsgboxStyle.information)

End Sub

Category is Byte [] save in the registry "

4. Get the latest added PST Store's Folder.

Get the latest added PST Store Folder

m_olnamespace.addstore (SSTOREPATH)

OpstFolder = m_olnamespace.folders.getlast

m_sstoreid = opstFolder.StoreID

DebugWriter ("StoreId:", M_SStoreID)

#REGION "Debug function, you can debug output, or output files"

Public Sub debugwriter (byval strsource as string, optional byval strmessage as string = "")

#If constdebugen

DIM Temppath as string = path.getTemppath ()

'Dim Temppath as string = "c: /"

Dim MyFile As New StreamWriter (Temppath & "Debug.txt", True)

Try

DIM strerror as string = now (). Tostring & Chr (9) & strsource & chr (9) & strmessage

Myfile.writeline (strerror)

Finally

Myfile.close ()

END TRY

#ELSE

Debug.writeline (strsource & chr (9) & strmessage)

#End IF

End Sub

#End region

5. Do some operations will appear Outlook safety warnings, such as: sending emails, query address ... Take a look at these:

Http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q290/4/99.asp&nowebcontent=1

Http://www.microsoft.com/china/msdn/library/dnout2k2/html/odc_olsecurityovw.asp#odc_olsecurityovw_topic7

6. Write here and think of adding

转载请注明原文地址:https://www.9cbs.com/read-27289.html

New Post(0)