Click here to Skip to main content
15,905,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: employee imformation list !!! Pin
OriginalGriff18-Jan-12 8:33
mveOriginalGriff18-Jan-12 8:33 
GeneralRe: employee imformation list !!! Pin
Dave Kreskowiak18-Jan-12 9:48
mveDave Kreskowiak18-Jan-12 9:48 
GeneralRe: employee imformation list !!! Pin
Pete O'Hanlon18-Jan-12 10:05
mvePete O'Hanlon18-Jan-12 10:05 
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 !!! PinPopular
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 
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 
OK, try this:
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);
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);
}

Forgive your enemies - it messes with their heads

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


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 

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.