Click here to Skip to main content
15,908,172 members
Home / Discussions / C#
   

C#

 
GeneralRe: employee imformation list !!! Pin
Dave Kreskowiak18-Jan-12 9:47
mveDave Kreskowiak18-Jan-12 9:47 
GeneralRe: employee imformation list !!! Pin
V.19-Jan-12 21:54
professionalV.19-Jan-12 21:54 
GeneralRe: employee imformation list !!! Pin
fafal20-Jan-12 1:54
fafal20-Jan-12 1:54 
GeneralRe: employee imformation list !!! Pin
V.20-Jan-12 4:00
professionalV.20-Jan-12 4:00 
AnswerRe: employee imformation list !!! Pin
PIEBALDconsult18-Jan-12 4:54
mvePIEBALDconsult18-Jan-12 4:54 
AnswerRe: employee imformation list !!! Pin
SilimSayo18-Jan-12 9:49
SilimSayo18-Jan-12 9:49 
GeneralRe: employee imformation list !!! Pin
PIEBALDconsult18-Jan-12 10:33
mvePIEBALDconsult18-Jan-12 10:33 
Questioncreating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 2:26
shinboxe18-Jan-12 2:26 
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:

C#
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.
AnswerRe: creating cross reference with c# and office.interop Pin
Paramu197318-Jan-12 3:15
Paramu197318-Jan-12 3:15 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 3:31
shinboxe18-Jan-12 3:31 
GeneralRe: creating cross reference with c# and office.interop Pin
Paramu197318-Jan-12 3:58
Paramu197318-Jan-12 3:58 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 4:24
shinboxe18-Jan-12 4:24 
GeneralRe: creating cross reference with c# and office.interop Pin
Paramu197318-Jan-12 4:31
Paramu197318-Jan-12 4:31 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 4:39
shinboxe18-Jan-12 4:39 
AnswerRe: creating cross reference with c# and office.interop Pin
Pete O'Hanlon18-Jan-12 4:54
mvePete O'Hanlon18-Jan-12 4:54 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 5:18
shinboxe18-Jan-12 5:18 
GeneralRe: creating cross reference with c# and office.interop Pin
Pete O'Hanlon18-Jan-12 5:24
mvePete O'Hanlon18-Jan-12 5:24 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 5:28
shinboxe18-Jan-12 5:28 
GeneralRe: creating cross reference with c# and office.interop Pin
Pete O'Hanlon18-Jan-12 5:26
mvePete O'Hanlon18-Jan-12 5:26 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 5:45
shinboxe18-Jan-12 5:45 
GeneralRe: creating cross reference with c# and office.interop Pin
Pete O'Hanlon18-Jan-12 5:57
mvePete O'Hanlon18-Jan-12 5:57 
GeneralRe: creating cross reference with c# and office.interop Pin
shinboxe18-Jan-12 21:16
shinboxe18-Jan-12 21:16 
QuestionHow to find the Selected Column Name of ListView Control ? Pin
Paramu197318-Jan-12 1:01
Paramu197318-Jan-12 1:01 
AnswerRe: How to find the Selected Column Name of ListView Control ? Pin
Eddy Vluggen18-Jan-12 7:08
professionalEddy Vluggen18-Jan-12 7:08 
GeneralRe: How to find the Selected Column Name of ListView Control ? Pin
Paramu197318-Jan-12 19:52
Paramu197318-Jan-12 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.