|
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.
|
|
|
|
|
OK, try this:
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);
int i = arr.Length;
while (i > 0)
{
object oRefItem = arr.GetValue(i--);
doc.Application.Selection.InsertCrossReference(ref oRefType, WdReferenceKind.wdContentText, ref oRefItem, ref oRefHyperlink, ref InsertPosition, ref SeperateNumbers, ref nullobj);
}
|
|
|
|
|
Thanks for your message,
unfortunately it didn't help, the problem isn't with getting the problem value from
oRefItem I think there is a certain bug in
InsertCrossReference function...
E.G: when I have 2 subjects over the document (1.1.1 SUBJECT1, 1.1.2 SUBJECT2) and I try to get ONLY the last subject, I keep getting the cross reference for the first subject.
|
|
|
|
|
What do you see in the values when you step over them in the debugger?
|
|
|
|
|
the array holds the correct values.
arr.GetValue(1)- Subject1
arr.GetValue(2) - Subject2
|
|
|
|
|
Hi,
Iam using C# 2010. I would like to know, is it possible to select a column name of listview?
I mean, once the user click on second column, then I want to get the second column value...also, once the user click on third column then the reslutant has to be thisd column value...
Is it possible?
Iam using the following codes...for listview...
for (int F12 = 0; F12 <= MyDataTable.Length - 1; F12++)
{
ListViewItem GItem = new ListViewItem(MyDataTable[F12]["invoic_no"].ToString());
GItem.SubItems.Add(MyDataTable[F12]["invoice_date"].ToString());
GItem.SubItems.Add(MyDataTable[F12]["Supplier_name"].ToString());
GItem.SubItems.Add(MyDataTable[F12]["itm_description"].ToString());
GItem.SubItems.Add(MyDataTable[F12]["unit_measure"].ToString());
GItem.SubItems.Add(MyDataTable[F12]["Invoice_Quantity"].ToString());
listView1.Items.Add(GItem);
}
listView1.Visible = true;
listView1.Focus();
Note: ListView1.SelectedItems[0].text or
ListView1.SelectedItems[0].SubItems[1].text all will give the value by assigned column.
But My clarification is is it possible to get the unkwon clicked column name...
Thanks
|
|
|
|
|
Using the ListView.HitTest[^] method; you give it the coordinates where the user clicked, and it'll return which subitem the user clicked on.
Bastard Programmer from Hell
|
|
|
|
|
Thanks Eddy. I Get Clear. 
|
|
|
|
|
You're welcome 
|
|
|
|
|
Please clarify:
Are you speaking here of an end-user clicking on a Column Header (i.e., the text in the column label area at the top), or are you speaking of an end-user clicking on an item in a Column, and from the item selected/clicked deducing the Column Header text ?
best, Bill
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
|
|
|
|
|
Thank you Bill.
Yes. Iam looking for the selected item value & its header text...The user will click on the item only...
And hence I need to find that value and its header text..
I found the answer with HitTest as Eddy has posted.
Thanks
modified 19-Jan-12 1:54am.
|
|
|
|
|
Hello,
I have many c# projects. I want know to create a Team Foundation project. I can't understand what it mean the Team Foundation Server. is it my IP @??
I want u help
regards
|
|
|
|
|
A few points:
1. This has nothing to do with C#
2. Googling would reveal a plethora of hits
3. Please try to avoid text speak. It only serves to annoy people. There are so many amazing letters in the English language, like the letter y. It's a shame to ignore them.
|
|
|
|
|
ok i know
Thank YOU for YOUR big help
Have a nice day
|
|
|
|
|
It is a server based application suited for development teams. It is not a project as such. Once you have TFS installed you can use it for project management, source control, continuous integration and a whole lot more.
TFS overview
"You get that on the big jobs."
|
|
|
|
|
I tried to compile a default C# template grid and get the following error message:
"Tool makepri.exe cannot be found. Please install Windows Modern SDK."
I did installation of Windows 8 on my machine and installed Visual Studio 11 Dev Preview just so that you know my congiruations.
Do I have to do an additional install?
Thanks,
Alex.
Alex Petrov
Software Developer
|
|
|
|
|
This is not a C# question, and belongs in this forum[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I want to make a program, i which, when a user SAYS "Draw circle", a circle should be drawn on the form.... i am working with windows forms c#.
i am familiar with
DrawCircle() method to draw
and
speechrecognizer
rec.LoadGrammar(g);

|
|
|
|
|
Great, let us know when you finish.
No comment
|
|
|
|
|
Excellent. I hope you write an article on it. Here's a couple of questions for you.
1. How do you know how big the circle has to be?
2. How do you know where to place the circle?
You might want to flesh your spec out a bit.
|
|
|
|