I
Irr
Hello,
I've recently dug into Word interop using c#.
The first thing I would like to see accomplished is to change the current
footers of a huge pile of .dots.
I've now succeeded in opening the Word Application and a Document in the
background and setting the focus on the footer of the document.
using:
WordDocument = WordApplication.Documents.Add(ref TemplatePath, ref Missing,
ref Missing, ref Missing);
// select de footer
WordApplication.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekCurrentPageFooter;
Next step would be to delete the current footer and replace it by:
VoettekstImage =
WordApplication.Selection.HeaderFooter.Shapes.AddPicture(LogoLocatie, ref
WordFalse, ref WordTrue, ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing);
Works, more or less, but some strange things occurs, sometimes the current
footer text doenst get deleted at all, sometimes it pastes the image so far
down only a small part of it is visible.
What I eventually would want to achieve is loading the picture into the
footer by using INCLUDEPICTURE, but when I try to do this using:
WordApplication.ActiveWindow.Selection.Fields.Add(WordApplication.ActiveWindow.Selection.Range,
Word.WdFieldType.wdFieldEmpty, "INCLUDEPICTURE
""C:\\mijnmap\\bedrijfslogo.png"" ", ref missing)
I get a literal, not a Field.
So my question in short;
How can I change the current footer into a Field which let a picture
include, any help would be greatly appreciated!
Regards.
I've recently dug into Word interop using c#.
The first thing I would like to see accomplished is to change the current
footers of a huge pile of .dots.
I've now succeeded in opening the Word Application and a Document in the
background and setting the focus on the footer of the document.
using:
WordDocument = WordApplication.Documents.Add(ref TemplatePath, ref Missing,
ref Missing, ref Missing);
// select de footer
WordApplication.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekCurrentPageFooter;
Next step would be to delete the current footer and replace it by:
VoettekstImage =
WordApplication.Selection.HeaderFooter.Shapes.AddPicture(LogoLocatie, ref
WordFalse, ref WordTrue, ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing);
Works, more or less, but some strange things occurs, sometimes the current
footer text doenst get deleted at all, sometimes it pastes the image so far
down only a small part of it is visible.
What I eventually would want to achieve is loading the picture into the
footer by using INCLUDEPICTURE, but when I try to do this using:
WordApplication.ActiveWindow.Selection.Fields.Add(WordApplication.ActiveWindow.Selection.Range,
Word.WdFieldType.wdFieldEmpty, "INCLUDEPICTURE
""C:\\mijnmap\\bedrijfslogo.png"" ", ref missing)
I get a literal, not a Field.
So my question in short;
How can I change the current footer into a Field which let a picture
include, any help would be greatly appreciated!
Regards.