Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all 1741 articles
Browse latest View live

New Post: RequestComAddinAutomationService Netoffice

$
0
0
Hi Sebastian,

thank you very much, your solution works perfectly. The workaround I found in the meantime was also to use the onConnection event,
  if ((AddInInst as Microsoft.Office.Core.COMAddIn) != null)
   {
                    Microsoft.Office.Core.COMAddIn comaddin = AddInInst as Microsoft.Office.Core.COMAddIn;
                    comaddin.Object = objectToBeUsed;
    }
but the solution via reflection is much more elegant.

Dominik

Created Unassigned: OutLook add 2000 contacts with high cpu usage [21906]

$
0
0
my outlook can't response any operation and my cpu 100% usage,when I added 500 contacts

my test Environment is __Intel(R)Pentium(R) CPU G2010 @2.8GHz 2.79GHz__

Here is my code:

```
var folderContacts = _outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderContacts);

var a = folderContacts.Folders.Add(string.Format("test contacts{0}", folderContacts.Folders.Count));
a.ShowAsOutlookAB = true;

var watch = new Stopwatch();
watch.Start();

for (var i = 0; i < 100; i++)
{
var newContact = (NetOffice.OutlookApi.ContactItem)_outlookApplication.CreateItem(OlItemType.olContactItem);

newContact.FirstName = "first" + i;
newContact.MiddleName = "middle" + i;
newContact.LastName = "last" + i;
newContact.CompanyName = "Intsig";
newContact.Department = "Windows";
newContact.JobTitle = "coder";
newContact.Email1Address = "aaa@yopmail.com";
newContact.Email2Address = "bbb@yopmail.com";
newContact.Email3Address = "ccc@yopmail.com";
newContact.Birthday = DateTime.Now;
newContact.BusinessAddressCity = "ShangHai";
newContact.BusinessAddressCountry = "China";
newContact.BusinessAddressPostalCode = "200000";
newContact.BusinessAddressState = "Yang Pu";
newContact.BusinessAddressStreet = "East NanJing Road";
newContact.MobileTelephoneNumber = "14258796543";
newContact.HomeFaxNumber = "021-32183231";
newContact.HomeTelephoneNumber = "021-38847282";
newContact.Home2TelephoneNumber = "021-33843739";
newContact.BusinessTelephoneNumber = "12548795642";
newContact.Business2TelephoneNumber = "13648572492";
newContact.Categories = "Role";
newContact.AssistantName = "Cortana";
newContact.WebPage = "www.baidu.com";
newContact.IMAddress = "45879542135";
newContact.NickName = "nick name";
newContact.Body = "just for test";

newContact.Move(a);

//Thread.Sleep(100);
}
```

Commented Unassigned: OutLook add 2000 contacts with high cpu usage [21906]

$
0
0
my outlook can't response any operation and my cpu 100% usage,when I added 500 contacts

my test Environment is __Intel(R)Pentium(R) CPU G2010 @2.8GHz 2.79GHz__

Here is my code:

```
var folderContacts = _outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderContacts);

var a = folderContacts.Folders.Add(string.Format("test contacts{0}", folderContacts.Folders.Count));
a.ShowAsOutlookAB = true;

var watch = new Stopwatch();
watch.Start();

for (var i = 0; i < 100; i++)
{
var newContact = (NetOffice.OutlookApi.ContactItem)_outlookApplication.CreateItem(OlItemType.olContactItem);

newContact.FirstName = "first" + i;
newContact.MiddleName = "middle" + i;
newContact.LastName = "last" + i;
newContact.CompanyName = "Intsig";
newContact.Department = "Windows";
newContact.JobTitle = "coder";
newContact.Email1Address = "aaa@yopmail.com";
newContact.Email2Address = "bbb@yopmail.com";
newContact.Email3Address = "ccc@yopmail.com";
newContact.Birthday = DateTime.Now;
newContact.BusinessAddressCity = "ShangHai";
newContact.BusinessAddressCountry = "China";
newContact.BusinessAddressPostalCode = "200000";
newContact.BusinessAddressState = "Yang Pu";
newContact.BusinessAddressStreet = "East NanJing Road";
newContact.MobileTelephoneNumber = "14258796543";
newContact.HomeFaxNumber = "021-32183231";
newContact.HomeTelephoneNumber = "021-38847282";
newContact.Home2TelephoneNumber = "021-33843739";
newContact.BusinessTelephoneNumber = "12548795642";
newContact.Business2TelephoneNumber = "13648572492";
newContact.Categories = "Role";
newContact.AssistantName = "Cortana";
newContact.WebPage = "www.baidu.com";
newContact.IMAddress = "45879542135";
newContact.NickName = "nick name";
newContact.Body = "just for test";

newContact.Move(a);

//Thread.Sleep(100);
}
```
Comments: ** Comment from web user: tim_qin **

is there anybody help me?

Commented Unassigned: OutLook add 2000 contacts with high cpu usage [21906]

$
0
0
my outlook can't response any operation and my cpu 100% usage,when I added 500 contacts

my test Environment is __Intel(R)Pentium(R) CPU G2010 @2.8GHz 2.79GHz__

Here is my code:

```
var folderContacts = _outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderContacts);

var a = folderContacts.Folders.Add(string.Format("test contacts{0}", folderContacts.Folders.Count));
a.ShowAsOutlookAB = true;

var watch = new Stopwatch();
watch.Start();

for (var i = 0; i < 100; i++)
{
var newContact = (NetOffice.OutlookApi.ContactItem)_outlookApplication.CreateItem(OlItemType.olContactItem);

newContact.FirstName = "first" + i;
newContact.MiddleName = "middle" + i;
newContact.LastName = "last" + i;
newContact.CompanyName = "Intsig";
newContact.Department = "Windows";
newContact.JobTitle = "coder";
newContact.Email1Address = "aaa@yopmail.com";
newContact.Email2Address = "bbb@yopmail.com";
newContact.Email3Address = "ccc@yopmail.com";
newContact.Birthday = DateTime.Now;
newContact.BusinessAddressCity = "ShangHai";
newContact.BusinessAddressCountry = "China";
newContact.BusinessAddressPostalCode = "200000";
newContact.BusinessAddressState = "Yang Pu";
newContact.BusinessAddressStreet = "East NanJing Road";
newContact.MobileTelephoneNumber = "14258796543";
newContact.HomeFaxNumber = "021-32183231";
newContact.HomeTelephoneNumber = "021-38847282";
newContact.Home2TelephoneNumber = "021-33843739";
newContact.BusinessTelephoneNumber = "12548795642";
newContact.Business2TelephoneNumber = "13648572492";
newContact.Categories = "Role";
newContact.AssistantName = "Cortana";
newContact.WebPage = "www.baidu.com";
newContact.IMAddress = "45879542135";
newContact.NickName = "nick name";
newContact.Body = "just for test";

newContact.Move(a);

//Thread.Sleep(100);
}
```
Comments: ** Comment from web user: SebastianDotNet **

its outlook work together with MS-Exchange server in your scenario?

*Sebastian

Commented Unassigned: OutLook add 2000 contacts with high cpu usage [21906]

$
0
0
my outlook can't response any operation and my cpu 100% usage,when I added 500 contacts

my test Environment is __Intel(R)Pentium(R) CPU G2010 @2.8GHz 2.79GHz__

Here is my code:

```
var folderContacts = _outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderContacts);

var a = folderContacts.Folders.Add(string.Format("test contacts{0}", folderContacts.Folders.Count));
a.ShowAsOutlookAB = true;

var watch = new Stopwatch();
watch.Start();

for (var i = 0; i < 100; i++)
{
var newContact = (NetOffice.OutlookApi.ContactItem)_outlookApplication.CreateItem(OlItemType.olContactItem);

newContact.FirstName = "first" + i;
newContact.MiddleName = "middle" + i;
newContact.LastName = "last" + i;
newContact.CompanyName = "Intsig";
newContact.Department = "Windows";
newContact.JobTitle = "coder";
newContact.Email1Address = "aaa@yopmail.com";
newContact.Email2Address = "bbb@yopmail.com";
newContact.Email3Address = "ccc@yopmail.com";
newContact.Birthday = DateTime.Now;
newContact.BusinessAddressCity = "ShangHai";
newContact.BusinessAddressCountry = "China";
newContact.BusinessAddressPostalCode = "200000";
newContact.BusinessAddressState = "Yang Pu";
newContact.BusinessAddressStreet = "East NanJing Road";
newContact.MobileTelephoneNumber = "14258796543";
newContact.HomeFaxNumber = "021-32183231";
newContact.HomeTelephoneNumber = "021-38847282";
newContact.Home2TelephoneNumber = "021-33843739";
newContact.BusinessTelephoneNumber = "12548795642";
newContact.Business2TelephoneNumber = "13648572492";
newContact.Categories = "Role";
newContact.AssistantName = "Cortana";
newContact.WebPage = "www.baidu.com";
newContact.IMAddress = "45879542135";
newContact.NickName = "nick name";
newContact.Body = "just for test";

newContact.Move(a);

//Thread.Sleep(100);
}
```
Comments: ** Comment from web user: tim_qin **

@SebastianDotNet
My test machine is working without any email server.

Commented Unassigned: Parameter not optional exception thrown [20295]

$
0
0
Hi,

I'm working through an example tutorial to create a VBA addin using VB.net. The tutorial is here:
http://www.mztools.com/articles/2012/MZ2012013.aspx

I'm deviating from the tutorial by utilising NetOffice interop assemblies instead of the tutorial recommendation to create my own private assemblies. I have managed to get most of the code working but get a "Parameter not optional" exception when I try to press one of the custom buttons on the menu.

My code can be accessed at:
https://github.com/rossknudsen/VbaAddin/tree/master

The error occurs at line 128 of connect.vb. Any help to understand what is going on would be much appreciated.

Regards

Ross
Comments: ** Comment from web user: ckuhn203 **

Any plans on fixing this? It makes your beautiful project worthless for trying to create VBE add-ins.

Commented Unassigned: Parameter not optional exception thrown [20295]

$
0
0
Hi,

I'm working through an example tutorial to create a VBA addin using VB.net. The tutorial is here:
http://www.mztools.com/articles/2012/MZ2012013.aspx

I'm deviating from the tutorial by utilising NetOffice interop assemblies instead of the tutorial recommendation to create my own private assemblies. I have managed to get most of the code working but get a "Parameter not optional" exception when I try to press one of the custom buttons on the menu.

My code can be accessed at:
https://github.com/rossknudsen/VbaAddin/tree/master

The error occurs at line 128 of connect.vb. Any help to understand what is going on would be much appreciated.

Regards

Ross
Comments: ** Comment from web user: ckuhn203 **

The same problem exists with CodeModule.Find(). Many of the parameters are defined as values when they should be defined as `ref` params.

Created Unassigned: Missing source file [21907]

$
0
0
Hi,

I just tried downloading the latest source and 'Tools\Utils\ApplicationUtils.cs' is missing from the WordApi project. So I can't build the solution currently.

Cheers

Ross

Commented Unassigned: Parameter not optional exception thrown [20295]

$
0
0
Hi,

I'm working through an example tutorial to create a VBA addin using VB.net. The tutorial is here:
http://www.mztools.com/articles/2012/MZ2012013.aspx

I'm deviating from the tutorial by utilising NetOffice interop assemblies instead of the tutorial recommendation to create my own private assemblies. I have managed to get most of the code working but get a "Parameter not optional" exception when I try to press one of the custom buttons on the menu.

My code can be accessed at:
https://github.com/rossknudsen/VbaAddin/tree/master

The error occurs at line 128 of connect.vb. Any help to understand what is going on would be much appreciated.

Regards

Ross
Comments: ** Comment from web user: SebastianDotNet **

the problem is identified.

in fact: NetOffice replace null argument values with System.Reflection.Type.Missing. (also for ref arguments) this replacement behavior cause problems for the ref's. (i'm sorry, ref argument in methods is a very rare scenario and i dont test this yet. btw: NetOffice is aware of ref arguments in event triggers. )

as hot fix: initialize your ref argument with "new object();" to avoid the NetOffice "replace behavior". if its not null then NetOffice dont touch them.

*Sebastian


Patch Uploaded: #17598

$
0
0

pico1234 has uploaded a patch.

Description:
Here is a patch to fix VBIDE\DispatchInterfaces\_Windows.cs and _CodeModule.cs. The method signatures require some parameters to be passed by reference. Note that the _CodeModule.Find() method is only the simple version, you can update the overloads similarly.

I hope that you can understand the patch file, I wasn't sure how to configure it for each source file. If the format isn't acceptable, let me know how to get it to a consistent format. I don't really know SVN.

Regards
Ross

Patch Uploaded: #17599

$
0
0

pico1234 has uploaded a patch.

Description:
Actually, I think this is a better format for the previously uploaded patch.

Commented Unassigned: Parameter not optional exception thrown [20295]

$
0
0
Hi,

I'm working through an example tutorial to create a VBA addin using VB.net. The tutorial is here:
http://www.mztools.com/articles/2012/MZ2012013.aspx

I'm deviating from the tutorial by utilising NetOffice interop assemblies instead of the tutorial recommendation to create my own private assemblies. I have managed to get most of the code working but get a "Parameter not optional" exception when I try to press one of the custom buttons on the menu.

My code can be accessed at:
https://github.com/rossknudsen/VbaAddin/tree/master

The error occurs at line 128 of connect.vb. Any help to understand what is going on would be much appreciated.

Regards

Ross
Comments: ** Comment from web user: pico1234 **

Hi Sebastian,

I've uploaded a patch for this issue. Now I review the issue after a few more years experience (and now knowing C#) I understand what is going on.

Point of interest is the [DispatchWrapper](https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dispatchwrapper(v=vs.100).aspx) class which provides the key functionality.

Hope that you can make sense of what I've uploaded and can make NetOffice better.

Regards

Ross

Commented Unassigned: Missing source file [21907]

$
0
0
Hi,

I just tried downloading the latest source and 'Tools\Utils\ApplicationUtils.cs' is missing from the WordApi project. So I can't build the solution currently.

Cheers

Ross
Comments: ** Comment from web user: SebastianDotNet **

thanks for pointing this out.

what is it ? release package, preview release or latest source state?

*Sebastian

New Post: NetOffice Outlook Plugin Deployment - No Idea How

$
0
0
Hi Sebastian,

first of all thanks for the great library you have created!!!

I am using it to develop an Office plugin. This plugin is working on my local machine when (somehow magically) deployed through Visual Studio. All fine till here. However, I need to deploy it to other people's computers (who do not have VS installed) and I am really struggling to find a way on how to do that.

My plugin looks like this:
[COMAddin(Constants.ProjectName, "Tool", 3)]
[Guid("B3F60319-1A11-4F3E-9C1B-3AE908D9CA86"), ProgId("Tool.OutlookIntegration")]
public class OutlookIntegration : COMAddin
{
    public OutlookIntegration()
    {
        this.OnStartupComplete += new OnStartupCompleteEventHandler(this.Integrate);

        _settings = new Settings();
    }

    /* Integrate creates a menu item which does what I need. */
}
The project type is library. Now, the question is how do I make this run on someone elses PC? If you happen to know about some tutorial or anything like that, please let me know.

I am also happy to provide any additional details needed.

Best regards,
D.

Commented Unassigned: Missing source file [21907]

$
0
0
Hi,

I just tried downloading the latest source and 'Tools\Utils\ApplicationUtils.cs' is missing from the WordApi project. So I can't build the solution currently.

Cheers

Ross
Comments: ** Comment from web user: pico1234 **

Sorry for the late reply, Codeplex has been down for a few days.

Yes, it is the latest source state (https://netoffice.codeplex.com/SourceControl/latest). I'm not sure if it is missing elsewhere.

Regards

Ross


New Post: Office 2016 support

$
0
0
Hi Sebastian,

I haven't personally tried NetOffice with Office 2016 yet and you may be aware of the open availability of Office 2016 Preview already. But just in case, here's where you can get it:

https://products.office.com/en-us/office-2016-preview

They have a key posted right on that page and I didn't need to sign in to download the installer.

Hopefully it just works without too much effort. NetOffice is a great product and I'm very happy seeing that you're interested in continuing to support it.

Mike

New Post: How to embed an image in email body

Source code checked in, #114229

$
0
0
[Regular Commit] - add PerformanceTrace (see how long need any single call to MS-Office or just some selected) - add concept test 'Performance Trace' - add missing source file Word\Tools\ApplicationUtils.cs - fix minor issue in Toolbox=>extract additional default languages to filesystem - move CommonUtils from namespace 'Tools' to 'Tools\Utils' - update assemblies

Released: NetOffice 1.7.3 (Feb 25, 2015)

$
0
0
Download 1: NetOffice Release 1.7.3

Includes:
- Binaries .NET : v2.0, v3.0, v3.5, v4.0, v4.5
- Tutorials/Examples in C#/VB.Net
- Source Code

Download 2: NetOffice Developer Toolbox
requires .NET 4(Client Profile)

Features:

- Project Wizard
- Office Compatibility
- Application Observer
- Registry Editor
- Addin Guard
- Outlook Security
- Office UI

Updated Release: NetOffice 1.7.3 (Feb 25, 2015)

$
0
0
Download 1: NetOffice Release 1.7.3

Includes:
- Binaries .NET : v2.0, v3.0, v3.5, v4.0, v4.5
- Tutorials/Examples in C#/VB.Net
- Source Code

Download 2: NetOffice Developer Toolbox
requires .NET 4(Client Profile)

Features:

- Project Wizard
- Office Compatibility
- Application Observer
- Registry Editor
- Addin Guard
- Outlook Security
- Office UI
Viewing all 1741 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>