|
fafal wrote: i have not enough time
So, how did you assume others here have enough time to do "your" homework.
|
|
|
|
|
yeah your righ but i never think like you when someone need help , and i dont khow why here all are furious tnx anyway
|
|
|
|
|
Because we do not do homework for you.
And of course, we are ready to help you if you have tried something on your own and come here with specific questions. But that doesn't seem to be the case.
|
|
|
|
|
ok give in
|
|
|
|
|
I don't think anyone here is furious - if they had been the tone of the messages you got would have been very different, I think.
But, most of us here have worked hard to get where we are, and we know that doing your homework would not help us and would not help you. All it would do is reinforce the idea you seem to have that "deadlines are for other people" and that someone will drag your backside out of the fire if you can't be bothered to plan your time.
Unfortunately, the real world is not like that.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
fafal wrote: i dont khow why here all are furious
Because there's way too many Copy'N'Paste coder idiots in this field who don't know what they're doing and getting paid to write production code.
|
|
|
|
|
I don't think everybody is furious. The tone would be far nastier if they were. What you have to understand, though, is that your original statement was far too vague, and far too broad. We don't know what technology (other than C#) you are using, and we don't know what you've done so far - it's up to you to help us help you.
Have you got any code in place at all?
|
|
|
|
|
In that case, you're screwed! Nobody is going to do your homework for you. If you didn't make the time to do your own work, why should we do it for you??
|
|
|
|
|
read this[^]
fafal wrote: and i have not enough time
What makes you think we do?
Try it out for yourself first. You can get directions here if you're stuck (follow guidelines in the link), but nobody's going to give you code or do your homework for you.
V.
|
|
|
|
|
ok tnx
|
|
|
|
|
You're welcome. And seriously, if you do run into problems, return here (with the rules in mind) and you'll certainly get response.
V.
|
|
|
|
|
|
Are you thinking out loud?
|
|
|
|
|
You're half right.
|
|
|
|
|
Hey,
Im trying to insert cross reference into a word document, the document itself is consists of 2 headings:
1.1.1 SUBJECT1
1.1.2 SUBJECT2
while trying to iterate through all the subjects with GetCrossReferenceItems(ref oRefType); function I do get both of the subjects, however, when I use the InsertCrossReference function, it always inserts the last subject into the document (meaning, I get duplicate SUBJECT2 cross references)
See below simplified example:
object file = @"c:\somefile.docx";
object oRefHyperlink = true;
object oRefType = WdReferenceType.wdRefTypeHeading;
object arr_r = doc.GetCrossReferenceItems(ref oRefType);
Array arr = ((Array)(arr_r));
Microsoft.Office.Interop.Word.Application document = new Microsoft.Office.Interop.Word.Application();
Document doc = document.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
object oRefItem = arr.GetValue(arr.Length);
doc.Application.Selection.InsertCrossReference(ref oRefType, WdReferenceKind.wdContentText, ref oRefItem, ref oRefHyperlink, ref InsertPosition, ref SeperateNumbers, ref nullobj);
oRefItem = arr.GetValue(1);
doc.Application.Selection.InsertCrossReference(ref oRefType, WdReferenceKind.wdContentText, ref oRefItem, ref oRefHyperlink, ref InsertPosition, ref SeperateNumbers, ref nullobj);
has anyone came crossed into this problem?
Thank you for your response.
|
|
|
|
|
Before when I used the vb.net I faced the similar problem. Then I remember instead of using the Cross Reference, I used the Paragraphs.And then I found a solution to my problem...
In richTextBox you can append the text easily, and save as document file....
|
|
|
|
|
Unfortunately there are alot of actions I need to do over the document , in fact, the entire application is based on word document so I can't do these actions over the rich text box
can you please expand alittle about the Paragraphs thingy ? how did you do it ?
|
|
|
|
|
Shine..actually its vb.net2008 code..I don't have time to convert to c#..so you need to convert it.
Dim OPara1 As Microsoft.Office.Interop.Word.Paragraph
Dim Rng As Microsoft.Office.Interop.Word.Range = WrdDcmt.Paragraphs(1).Range
OPara1 = WrdDcmt.Paragraphs.Add
OPara1.Format.SpaceBefore = 50
OPara1.Range.Text = "REFERENCE No. : AMC/" + Dprt + "/" + DvPoint + "/MPR-" + TextBox1.Text + vbCrLf
OPara1.Range.Text = "DATE : " + QtRqt
OPara1.Format.SpaceAfter = 6
OPara1.Range.InsertParagraphAfter()
For RichTextBox
RichTextBox4.AppendText("DATE : " + QtRqt)
RichTextBox4.AppendText(" " + vbCrLf)
RichTextBox4.AppendText("To" + vbCrLf)
RichTextBox4.AppendText("Some of Your Text" + vbCrLf)
// Simply you can copy the rtb Text and can Paste to your Range and can add to your document..
RichTextBox4.SelectAll()
RichTextBox4.Copy()
Rng.Paste()
I hope this can helps a bit for your search
|
|
|
|
|
First of all thank alot for your help
As far as i can see you enter the Cross Reference programmatically, am I right ?
can you please help me understand this line ?
OPara1.Range.Text = "REFERENCE No. : AMC/" + Dprt + "/" + DvPoint + "/MPR-" + TextBox1.Text + vbCrLf
thank you
|
|
|
|
|
Those are strings - DPRT & DvPoint
|
|
|
|
|
So I still don't understand how the Cross reference is being made :[]
you don't use the InsertCrossReference Function over here
|
|
|
|
|
you don't actually seem to be inserting the value at position 0. Taking a look at your assignments to oRefItem , you actually start at the length of the array (which would be after the end of the array). Surely you want to assign it here as arr.GetValue(0);
|
|
|
|
|
Hey Pete,
The array holds values from index 1 to n, index 0 throws out of range exception
|
|
|
|
|
How on earth has this been created? Standard indexing in C# is zero-based.
|
|
|
|
|
The
object arr_r = doc.GetCrossReferenceItems(ref oRefType); return non-zero indexed array (string[*]) which forces the programmer to cast a non-zero array.
|
|
|
|