|
Hi
I want to find the Last Modifed Date of the Word Document I have. I am using a code sample available from Internet but unable to get the date. The code sample was to get Author Property. I changed it to get Last Modified Date. But it is throwing Exception "Exception thrown while Invocation". I guess the problem is in the string I am using to get the Last Modified Date.
Please find the code Sample and give me a solution.String "Prop" is the key to find Last Modified Date.
object Missing = Missing.Value;
object BuiltInProps;
object CustomProps;
Word._Document Doc;
Word.ApplicationClass MyWord = new Word.ApplicationClass();
MyWord.Visible = true;
Doc = MyWord.Documents.Add(ref Missing, ref Missing, ref Missing, ref Missing);
BuiltInProps = Doc.BuiltInDocumentProperties;
Type TypeBuiltingProp = BuiltInProps.GetType();
//Setting a built-in property
string Prop = "Modified Date";
string PropValue;
object ModifiedProp = TypeBuiltingProp.InvokeMember("item", BindingFlags.Default | BindingFlags.GetProperty, null, BuiltInProps, new Object[] { Prop });
Type TypeModifiedProp = ModifiedProp.GetType();
PropValue = TypeModifiedProp.InvokeMember("Value", BindingFlags.Default | BindingFlags.GetProperty, null, ModifiedProp, new Object[]{}).ToString();
The sample I got from the site
http://www.java2s.com/Code/CSharp/Office/ModifyWordDocumentProperties.htm
Kindly reply to me fast
With Regards,
Abraham Chethuvelil
|
|
|
|
|
hi,
abraham i m new to this.
still a suggestion its better to use system registry to store and retrive the last modified date of the document
i hope this will work
regards
sindhu tiwari
Always Innovative
|
|
|
|
|
Hi Sindhu,
I think there is no need for System Registry for this, because I am able to get other properties like - Author, Subject, Keywords and Creation Date by changing the value of string Prop like,
string Prop = "Creation Date";
string Prop = "Keywords";
string Prop = "Author";
string Prop = "Subject";
For all these it is working. As you are new to this I can tell you these will be present in Word Document's Property Tab. You can see these properties in File-> Properties -> Summary/Statistics Tabs.
I need the String like "Creation Date" because I tried so many combinations to get modified date like - Modified Date,Modification Date, Last Modified etc. But its giving an Exception.
Thanking you and expecting your favorable reply
With Regards,
Abraham Chethuvelil
|
|
|
|
|
Hi,
you can use
string Prop = "Last Save Time";
grettings
Aldo Vasquez
|
|
|
|
|
Can someone suggest an idea on how to achieve Recursive Alarm (ie) if i set an alarm for 7.00 AM it must repeat everyday.
Reena.
|
|
|
|
|
hi,
happy new year,
there must be a fuction which checks weather current time is equal to the desired alarm time or not ...so the function must be executed repeatedly for this, there are two option the first one is timer and the second one is thread use either of them...to do this
if i want to select i would have gone for thread ....
Regards
sindhu tiwari
its me sid
|
|
|
|
|
Hello experts,
I made a desktop application using C#.NET 2005 using MS-ACCESS as a back-end, application is working fine. I also make a setup using .NET setup and deployment project.
When I make the installer I also add the database file with EXE and DLL's suppose the database location is C:\MyProj\test\abc.mdb
Now v1.0 is released. And I start working on new version, In that along with the code there are few database changes are also applied.
I make separate folder for each version, Now one of my client is need some amendments in v1.0, but when I going to make installer it will take old database file. ..?
Actually in .net setup and deployment project the external files(Text, Database etc.) are added with full path information. I want to make is dynamic I.e. I want to add files of same folder.
So v1.0 is having old database and other files and v1.1 is having new database file.
How Can I achive that...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
actually what is the issue now, anyway you can specify the database name before taking the exe.
better don't put db along with exe, make a separate folder and keep the database there.
when I going to make installer it will take old database file. ..?..... you can specify the database which you need.
My small attempt...
|
|
|
|
|
Thanks for your reply...
The issue is: Suppose My project is placed in C:\MyProject\v1.0
And Database is placed at C:\MyProject\v1.0\Database\Mydata.mdb.
Now I make setup for that then it will take database from "C:\MyProject\v1.0\Database\Mydata.mdb" Ok...?
Now I make a new version of application then my project location is
C:\MyProject\v1.1
And database location became
C:\MyProject\v1.1\Database\Mydata.mdb. ... true?
When I make the installer for v1.1 it will receive the database file from the "C:\MyProject\v1.0\Database\Mydata.mdb". But I want to take the file from ""C:\MyProject\v1.1\Database\Mydata.mdb" .
For solve this problem I have to change the location of file in setup project right...?
But I have more than 20 files (XML, Text files etc.) including database file. I have to change them also.
Suppose I move to v1.2 then I have to repeat the same things again (Update the files location)
What I want...?
I want a setting that will take database and other files from the current working directory. I.e
"C:\MyProject\v1.0\Database\Mydata.mdb" or
"C:\MyProject\v1.1\Database\Mydata.mdb" or
"C:\MyProject\v1.2\Database\Mydata.mdb"
whatever version I build.
How to achieve that...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
When I make the installer for v1.1 it will receive the database file from the "C:\MyProject\v1.0\Database\Mydata.mdb". But I want to take the file from ""C:\MyProject\v1.1\Database\Mydata.mdb" . hw it happen? here v1.0 and v1.1 aer 2 different folders right?
My small attempt...
|
|
|
|
|
You can also try this yourself....
This is happening because .NET setup project used the hard coded path.
I have to change it in each release.
How can I make it dynamic...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
what is the difference between observer pattern? Aren't they both the same thing
|
|
|
|
|
No, they're not.
The observer pattern allows an object to observe (listen to) the state of another object - i.e. be notified of changes of state of the object being observed. The delegate pattern (this has little to do with a specific programming language) is used by an object that publicly defines some behavior to delegate the responsibility of performing that behavior to another object.
/ravi
|
|
|
|
|
I'm having error "The requested FTP command is not supported when using HTTP proxy.". I'm using proxy for the internet. When browsing for answer, I think the problem is in FtpWebRequest.Proxy. I use :
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(uri);
reqFTP.Proxy = new WebProxy("10.10.10.1");
But the same error still occur. Can you help? Thanks.
|
|
|
|
|
How can I get the location of the file being streamed from the "System.IO.Stream" class?
|
|
|
|
|
The Stream class is an abstract base class, and derived classes may not represent a file (for example, MemoryStream represents an in-memory byte stream). In .NET, the FileStream class is usually used to deal with file I/O, so if the stream you're dealing with is based on a file, the Stream will likely be a FileStream instance. You can use FileStream.Name to get the original filename - for example:
string GetStreamFilename(Stream stream)
{
FileStream fs=stream as FileStream;
if(fs!=null)
return fs.Name;
return null;
}
|
|
|
|
|
I am writing an installer for my Paint.NET plugin. But it has two versions that work with different versions of the program. How can I programmatically determine the version the user is running so that the installer knows which plugin version to install?
|
|
|
|
|
|
Hi
I have a strange problem and I can't realize what's going on.I have a UserControl that's inherited from another UserControl.Every time I want to open its designer,a clear surface is shown (actually its base class designer is showing) I have tried cleaning and rebuilding the project,reopening the VS and even I shut down my computer but the problem still exists.
Please help me if you know what's going on
Thank you for your help
modified on Wednesday, January 02, 2008 12:10:04 AM
|
|
|
|
|
Did you just said "Urgent"
You should be very brave to mention this word here in the cp
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
beatles1692 wrote: Why I should be brave ?
It takes nerve to exclaim "urgent" on CP because people consider it extremely obnoxious. They take it as if you are demanding that someone help you, instead of asking politely.
Putting "Urgent!!!!!" into your subject line is the #1 way to get your post ignored. And that goes for most boards, not just CP.
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
Does anyone has any experience working with the System.ComponentModel.LicenseProviderAttribute framework?
More specifically, I am in the process of reviewing our licensing model, and came across this framework. Does anyone has any experience with this?
We are looking for the ability to keep track of flags and number of uses of certain features.
We would also like to allow our users to generate their own license keys, so some kind of web interface would be needed....
I'm looking into these options:
1. Writing our own custom framework
2. Using the LicenseProviderAttribute framework (if it will be feasible)
3. DeployLX (by XHEO)
4. Any idea you might have...
|
|
|
|
|
|
Hi everybody
i need some articles or hints about getting all the text in a word document using csharp, the text to get includes the text in all kinds of shapes, header footer, controls and all the complications of the word document
thanks a lot
|
|
|
|