|
Hi All,
In my application, i am automating the office word application. I need to retrieve the original setting of the input word document. How can i retrieve the header type from the document? Like header types are-
wdHeaderFooterPrimary
wdHeaderFooterEvenPages
wdHeaderFooterFirstPage
How to know that which setting is applied in the input document through code?
Viram Pandey
|
|
|
|
|
hi all,
I want export the pdf file.and I am using following code.In my system .But an error is displaying like adobe readercould not open 'down.pdf' because it is either not a supported file type or because the file has been damaged...
DataSet Ds = FillGrid2(sessionvalue, cid, cmid, crid, pid, sdate, edate);
Response.Clear();
Response.AppendHeader("Content-Type", "application/pdf");
Response.AppendHeader("Content-disposition", "attachment; filename=Download.pdf");
string str = "<table style='border:1px solid #000000;'>";
str += "<tr>";
str += "<td colspan='5'>" + "<b>Client: </b>" + client + "</td>";
str += "</tr>";
str += "<tr>";
str += "<td colspan='5'>" + "<b>Campaign: </b>" + campaign + "</td>";
str += "</tr>";
str += "<tr>";
str += "<td colspan='5'>" + "<b>Report Summary</b>" + "</td>";
str += "</tr>";
str += "<tr>";
str += "<td>" + "Type" + "</td>";
str += "<td>" + "Impression" + "</td>";
str += "<td>" + "Clicks" + "</td>";
str += "<td>" + "Start Date" + "</td>";
str += "<td>" + "End Date" + "</td>";
str += "</tr>";
for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
{
str += "<tr style='border:1px solid #000000;'>";
for (int j = 0; j < Ds.Tables[0].Columns.Count; j++)
{
str += "<td>" + Ds.Tables[0].Rows[i][j].ToString() + "</td>";
}
str += "</tr>";
}
str += "</table>";
Response.Write(str);
If anybody knows please reply me..
thanks...
Raaj
|
|
|
|
|
I doing this project that i have no idea in my mind at all. U guy out whoever pls help me..Thax alot.. get back to me asap Thax alot=)
The router n parents are all button. Once the sever click at the router, it will than show it deter how many parent it have or link and when the sever click at the parent is will show how many children the parent link to or have and it detail of it also like temperature, terminal ID and other. The symbol for the children is a circle. We need to connection them with arrow shown. It just like a family tree from router link to parent and from parent it show how many children it have. We need to use Visual studio 2005 and C# to create own button n image. This project is like a piece of empty sheet of paper/form and our duty is to draw family tree on it.
|
|
|
|
|
Hi,
This seems to be a 2D drawing related project, therefore, the best thing I could suggest you to is to use Drawing classes of .Net framework.
Please take a look at the following article which shows how to drawing classes of .Net framework.
ARTICLE[^]
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
A double-post (accidental, me thinks) does not require a double-answer
|
|
|
|
|
I doing this project that i have no idea in my mind at all. U guy out whoever pls help me..Thax alot.. get back to me asap Thax alot=)
The router n parents are all button. Once the sever click at the router, it will than show it deter how many parent it have or link and when the sever click at the parent is will show how many children the parent link to or have and it detail of it also like temperature, terminal ID and other. The symbol for the children is a circle. We need to connection them with arrow shown. It just like a family tree from router link to parent and from parent it show how many children it have. We need to use Visual studio 2005 and C# to create own button n image. This project is like a piece of empty sheet of paper/form and our duty is to draw family tree on it.
|
|
|
|
|
Hi,
This seems to be a 2D drawing project. The best thing I can suggest you to go throuhg the Drawing Classes of .Net framework (i.e, their methods, properties etc.) which can help you to draw the drawing ojects on the canvas.
Take a look at the following article, this might help you in understaing the capabilities of drawing classes of .Net.
ARTICLE1[^]
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Requirement:
How I can get all the applications registered in windows os includes with Administative Tools
using through "RegistryKey" or any other way
if have any please let me know
Thanks
Kiran.
|
|
|
|
|
|
Requirement:
Getting all the installed exe's in windows os and as well as Administrative tools also
if any idea please let me know
Thanks.
Kiran
|
|
|
|
|
Hi i am writing a C# class library which i want to use in my VB Client
So i wrote class like this
[Guid("0AA209CD-D713-4336-8804-F7D4888F58BD")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown )]
[ComVisible(true)]
public interface IClass1
{
void Temp1([MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr )] String[] IDs,int size);
}
[Guid("CCDAD140-DD55-4047-A925-A1B539396A01")]
[ComVisible(true)]
[ProgId("CommonCatalogue.Class1")]
public class Class1:IClass1
{
public void Temp1([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] String[] IDs, int size)
{
string TempDate = "dfdf";
}
}
but when i referenced this library (.tlb) in VB the temp method singnature coming as
Temp1(IDs As String, size As Long)
i am unable to fix this. Please can any one help me in figuring out this.
|
|
|
|
|
|
Thanks for the response.
Ya using ref in the method's declaration of C# we can get the correct syntax in VB but is there any other way which does not require any ref in the method declaration.
|
|
|
|
|
Hello!
My name is Alla. I'w working as a programmer in New Hampshire. I've just started doing Word and Powerpoint Automation (never done before Office Automation). The application I'm working on now creates document-packages,containing one or more Word documents and export these documents to particular locations.
I created Word Application Instance only once at the beginning, so I use this Instance for all documents that I'm going to create for exporting. Everything was fine so far, but when I'm trying to export a huge amount of documents,the following error appears - RPC SERVER UNAVAILABLE and any reference to existing Word Instance throws an error ( it happens when during processing some documents for some reason Range.Paste method throws an exception (RPC server failed)., then I get MS Word warning message and Word trying to recover documents. Immediately after that I get RPC SERVER UNAVAILABLE - means that any access to my Word Instance fails. May be it makes sense to create many Word Application Instances for each document, but we have problem with performance.I tried to send this question to microsoft forums, but nobody responded..Could you, please, help me to solve this problem?
Thank you very much in advance and best regards.
Alla
|
|
|
|
|
Hi,
I'm not very knowledgeable on threading...
I'm using Invoke to receive Serial Port data. The form locks when I try and call "this.Close()". Do I have to remove/stop the Invoke thread before using "this.Close()" to automatically close the form?
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
serialPortData = serialPort1.ReadExisting();
this.Invoke(new EventHandler(SerialPortEvent));
}
thanks,
Ron
|
|
|
|
|
myNameIsRon wrote: The form locks when I try and call "this.Close()". Do I have to remove/stop the Invoke thread before using "this.Close()" to automatically close the form?
If you have any active threads, it good to stop them while you close the form. You can do this in the Dispose method of your form.
|
|
|
|
|
Thanks Navaneeth,
What code would I use to stop an "this.Invoke()" thread?
Ron
|
|
|
|
|
If you use myThread.IsBackground = true; the thread will close automatically after this.Close()
|
|
|
|
|
Hi Mo,
I'm using "this.Invoke()". Should I be using a different type of thread? If not, how do I stop "this.Invoke()"?
Ron
|
|
|
|
|
Hey Ron.
I'm using IsBackground property for closing Thread with closing form.
myNameIsRon wrote: I'm using "this.Invoke()". Should I be using a different type of thread? If not, how do I stop "this.Invoke()"?
I don't know exactly.
|
|
|
|
|
Control.Invoke puts a serialised delegate onto the windows message loop.
How much work are you doing in your SerialPortEvent method? If you are doing enough work to block the UI up then you are probably blocking the serial library as well.
Consider taking data in the DataRecieved event, placing it on a queue, and perhaps Monitor.Pulse a background thread and returning out the event handler immediately to return control to the serial port code. Then your background thread can consume the data events that are on the queue, and process them. Then when you want to make UI changes, you either use Form.Invoke, or .BeginInvoke to make the required changes.
|
|
|
|
|
Thanks Mark,
The SerialPortEvent calls on a Method to parse the c/c swipe data. Is Method run through the Invoke thread, or the main thread?
private void SerialPortEvent(object sender, EventArgs e)
{
SwipeMethod(serialPortData);
}
Also, if I use ShowDialog() (instead of Show()) to open the Form, there is no issue with using this.Close().
Ron
|
|
|
|
|
SerialPortEvent is executed on the UI thread. So SwipeMethod will run on that same thread.
Not sure on the ShowDialog vs Show deal... but I haven't had very much coffee today
My worker thread/queue setup was based on the assumption you were processing bunches of data from a serial port. If you are popping a form with "Swipe CC now" then it might be worth looking at just using Delegate.BeginInvoke and IAsyncResult. This will use a thread from the pool.
|
|
|
|
|
Yes, I've been playing around some. I'm not sure if it's a bug in .NET 2.0. After the transaction is approved, I want to exit the Form with "this.Close()" but it locks the app. If I switch to BeginInvoke it works ok. Also, I can use Invoke, if I open the form with ShowDialog instead of Show.
Useful link:
avoid invoke
Ron
|
|
|
|
|
hi guys,
i have developed an application that will convert every image file in selected folder to .png and scale images to some specified sizes with checking which one is best. Those sizes are 64 128 256 512 1024 2048. The app checks which is nearest size to scale. For instance, if image dimension is (65 x 125) then it will scale it to 64 x 128 because 65 is nearest to 64 than 128 and 125 is nearest to 128 than 64 and so on...so to this i have coded the app like this :
private void button3_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
{
Xal.Clear();
getDirs(fbd.SelectedPath);
string[] tmp_filePaths = (string[])Xal.ToArray(typeof(string));
for (int a = 0; a < tmp_filePaths.Length; a++)
{
if (!tmp_filePaths[a].EndsWith(".txt"))
{
Image tmp_image = Image.FromFile(tmp_filePaths[a]);
int newwidth = roundToNearestPixel(tmp_image.Width);
int newheight = roundToNearestPixel(tmp_image.Height);
Bitmap tmp_bmp = new Bitmap(newwidth, newheight);
Graphics tmp_gra = Graphics.FromImage(tmp_bmp);
tmp_gra.DrawImage(tmp_image, 0, 0, newwidth, newheight);
tmp_bmp.Save(@"D:\texts\" + Path.GetFileNameWithoutExtension(tmp_filePaths[a]) + ".png", System.Drawing.Imaging.ImageFormat.Png);
tmp_gra.Dispose();
}
}
}
}
short[] dimensions = new short[] { 64, 128, 256, 512, 1024, 2048, 4096 };
int roundToNearestPixel(int value)
{
int result;
if (value <= 64)
{
result = 64;
return result;
}
int pointer = 0;
for (int a = 0; a < dimensions.Length; a++)
{
if (dimensions[a] >= value)
{
pointer = a;
break;
}
}
int shortdistance = value - dimensions[pointer - 1];
int largedistance = dimensions[pointer] - value;
if (shortdistance < largedistance)
result = dimensions[pointer - 1];
else
result = dimensions[pointer];
return result;
}
now its doing what i needed but it gives an error as well that is out of memory after every 174 images, i have commented that line. So can anybody tell me how to solve this ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|