|
|
-- Begin code
Outlook.Application oApplication = new ApplicationClass();
Outlook.Inspector oInspector;
Outlook.MailItem oMailItem;
oInspector = oApplication.ActiveInspector();
/* Fetch the message */
oMailItem = ((MailItem)oInspector.CurrentItem);
MessageBox.Show( "To: "+ oMailItem.To );
-- End code
The following code are executed from a button that are located
in the toolbar on the "New message form" in outlook.
The problem is that oMailItem.To string i empty (There are info in the
To field in the form)....
oMailItem.Body works perfectly and contains the message.
The strange thing is that if my plugin sets a value in oMailItem.To then
the To Field in the outlook form also updates.
Help needed =)
|
|
|
|
|
The Outlook object model doesn't code to read the To property based on similar reports. Try using the Recipients collection instead.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Probably old news but I just read about it.
http://www.eeggs.com/items/40319.html
There's a hidden message and game.
|
|
|
|
|
Does anyone know how to change folder permissions on Windows XP using C#? My problem is that when my application is run under the restricted account under windows XP the folder
All Users Application Data has only read access. I want to add write access to that folder the first time the application is run. The application has to be run by an administrator first so I was hoping to do it then.
Any Ideas?
Forever Developing
|
|
|
|
|
If you want your application to do some admin task in some place you can use WindowsIdentity.Impersonate() .Look for sample in MSDN.
Mazy
No sig. available now.
|
|
|
|
|
There's a couple of articles on this here on code project. A quick search revealed:- Adding File Access Permissions using DirectoryServices[^]
- NT Security Classes for .NET[^]
You could search for additional articles, as well as comments in this forum because it has been discussed several times before.
You probably shouldn't modify the ACL of the All Users directory, though. Users should not be able to write files to this directory. If you need the application to save files in a place where other users of the machine can access them, you should consider installing your program into C:\Program Files (where applications are supposed to go anyway) and use a folder within that. By default, most users can write to those directories. All Users is more for things like Start menu shortcuts available to everyone. Occassionally, net admins will put a README file in the Documents folder or something that user can't delete, but this is pretty rare these days with modern networks.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am only saving a .ini file there. The problem with saving the ini file settings to the application root folder is that under windows XP a restricted user has no rights to the program files folder.
Thanks for the information it is greatly appriciated.
Nick
Forever Developing
|
|
|
|
|
You should consider doing this in the setup of your application or using a separate .ini file for each user.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Also i would appreciate to know if there is a way to convert anything into a byte array ? (Like a class or a structure). This will help me to send data over network.
|
|
|
|
|
|
Wow. I didnot know such thing exist. Thx very much .
|
|
|
|
|
I am trying to insert a null value into a parameter value for a stored procedure. I set the IsNullable property to true, but it still will not execute the stored procedure unless I put something other than a null. Any ideas? Thanks.
|
|
|
|
|
Nevermind, I just needed to set the parameter value to DBNull.Value instead of null.
|
|
|
|
|
I have web service application which have two session which have two method,which Sessionenable property is enable in both. In second one I check if the session is not null and I do something after it. When I test my application in the test page of web servise it runs OK but when I test it in a ASP.NET client application it is obvious that the Session is null and my connditions does not work in second web service. Any idea?
Mazy
No sig. available now.
|
|
|
|
|
You must use a cookie container with each request. Sessions rely on storing a SessionId in a cookie. Without cookies enabled (or in this case, a container in which to store them), sessions won't work. Use the CookieContainer property in the Web Service class for your clients, inheritted from HttpWebClientProtocol ). It uses a System.Net.CookieContainer . Instantiating a new one and assigning the property should do the trick. Just make sure you reuse the CookieContainer . So long as the Web Service class remains instantiated, you shouldn't have to do anything else.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Heath,Thanks for your reply.I found it but I didn't want to mess up forum. One of my client will be VB.6 . Do you know ,does VB6 has this capability to set cookie container? I think there is no problem with that but I want to be sure.
Mazy
No sig. available now.
|
|
|
|
|
Not sure about that. It depends on how VB6 encapsulates the Web service, which I'm not familiar with. I'm sure this is not a new problem, so you could always try googling for an answer. I'd check what the class that's generated from the SOAP SDK (or whatever you're using to generate the VB6 class) supports, too. If you would be so kind, could you reply to what you found? I'd be interested to know, too.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
If you would be so kind, could you reply to what you found? I'd be interested to know, too.
Sure. I have to do this job until next weak and I'll tell you about. I have a VB6 CD at home at I have to test it there.
Mazy
No sig. available now.
|
|
|
|
|
Hi Heath:
I test a VB.6 client. I didn't know that vb.6 use XML Web Service like this. It doesn't create web service class or so,it just create a MSXML2.DomDocument and send an url which contain web service method name and get a XMLMessage . Do not need to set any cookie container or something else, Sessions works without any additional things for VB.6.Just send a url request and you will receive correct data.
Mazy
No sig. available now.
|
|
|
|
|
...which indicates the VBVM is most likely using the WinInet functions like Internet Explorer, which means they use the same cookie cache.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there a way to read the properties of a file on a http server?
I want to know when a specific file was modified, so I can make C# download it by itself when the local version is older than the one on the web.
|
|
|
|
|
See the HttpWebRequest and HttpWebResponse documentation in the .NET Framework SDK for more information. An snippet follows that shows how to get the last modification date/time of a document:
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://www.codeproject.com");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine(response.LastModified); The documentation for the first two classes have more elaborate examples, but the concept is the same.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I just wonder if there is any similar to doc/view in C# and the .NET Framework. I realy liked the doc/view project “in the old days” I used VC++ 6.0 and MFC.
...and justice for all
APe
|
|
|
|
|