设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 办公软件 >> Outlook >> Outlook add-in 插件.Net开发经验-补充(2.1)
精品推荐
Outlook点击TOP10
·OutLook Express邮件数据备份和恢复
·Outlook add-in 插件.Net开发经验
·如何使用Outlook Express拒收邮件
·邮件群发 我要与众不同 Outlook群发新主张
·用OutLook登陆Yahoo的1G邮箱
·硬盘空间不够 可能是Outlook Express惹的祸
·Outlook Add-in(COM加载项)技术指南(四)
·C#设计界面(office2003,VS。net IDE,OutLook 等等)
·五招搞定Outlook2003群发邮件功能
·取得的Outlook目录并在TTreeView里显示出来
办公软件点击TOP10
·Word公式编辑器快速上手指南
·轻松破解Word与Excel的文档密码
·巧用Word 2007制作发文件用的方格稿纸
·三步搞定幻灯片:Powerpoint 2007应用实例
·揪出Word工具中隐藏的秘密
·Excel填空型下划线的使用
·在Excel 2007中快速创建专业化的图表
·在Excel 2007中导入或导出文本文件
·Excel隔行调整行高的四种有效方法
·学PowerPoint模板技巧 提高制作效率
精选专题

Outlook add-in 插件.Net开发经验-补充(2.1)

作者: 来源:网络文章 时间:2005-12-13 21:04:56

这里上传文件字数太少,只能分多次。

1.         Outlook里创建Menu, ButtonXML:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Outlook里创建Menu, Button

Private m_oMainMenu As Office.CommandBarPopup

Private WithEvents mnuLogInOff As Office.CommandBarButton

 

Dim oBars As Office.CommandBars

Dim oMenuBar As Office.CommandBar

 

'添加及选择工具栏

oBars = m_olEXPlorer.CommandBars     '取所有菜单栏

oMenuBar = oBars.ActiveMenuBar    '取当前菜单栏

 

'添加主菜单

m_oMainMenu = CType(oMenuBar.Controls.Add(10, , , ,True),Office.CommandBarPopup)

m_oMainMenu.Caption = "MainMenu"

 

'添加菜单项

mnuLogInOff = CType(m_oMainMenu.Controls.Add(Type:=1), Office.CommandBarButton)      ', Temporary:=True, Before:=1)

mnuLogInOff.Caption = " mnuLogInOff"

mnuLogInOff.Enabled = True

 

2.         创建,修改Folder view

创建,修改Folder view

Folder view XML格式。

Dim myView As myOutlook.View

Dim myViews As myOutlook.Views

 

myViews = g_oBaseFolder.Views

myView = myViews.Add(Name:="XML:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Normal View", _                                   ViewType:=myOutlook.OlViewType.olTableView, SaveOption:=myOutlook.OlViewSaveOption.olViewSaveOptionAllFoldersOfType)

myView.XML = sViewXML

myView.Save()

 

3.         修改类别 category

category信息,存放在注册表内。

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

'增加,修改category,调试

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

Private Sub mnuDebug2_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, 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(sSubkey, sValueName, modOutlook.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;策略;等待;电话;个人;供应商;观点;国际;贺卡;假日;竞争;礼物;目标/目的;商务;时间和经费;收藏夹;熟人;杂项"

            sNewCategories = Trim(sNewCategories)

            If Right(sNewCategories, 1) = ";" Then

                sNewCategories = Trim(Left(sNewCategories, sNewCategories.Length - 1))

            End If

            oValue = EncodeChineseString2Unicode(sNewCategories)

            SetRegisterValue(sSubkey, sValueName, oValue)

 

            MsgBox(sNewCategories, MsgBoxStyle.Information)

 

        End Sub

Category在注册表里是byte[]保存

 

4.         得到最新添加的pst storefolder

得到最新添加的pst storefolder

m_olNamespace.AddStore(sStorePath)

oPstFolder = m_olNamespace.Folders.GetLast

m_sStoreID = oPstFolder.StoreID

DebugWriter("StoreID: ", m_sStoreID)

 

#Region "调试所用的函数,可以调试输出,或出文件"

     Public Sub DebugWriter(ByVal strSource As String, Optional ByVal strMessage As String = "")

 #If constDebug Then

            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.         做某些操作会出现Outlook得安全警告,例如:发送邮件,查询address ……

看看这些:

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.         先写到这里,想到了再补充

 


Outlook add-in 插件.Net开发经验-补充(2.1) 相关文章:
Outlook add-in 插件.Net开发经验-补充(2.1) 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com