Interop.Microsoft.Office.Core bug

G

Garrold

Hi,

I'm having a problem calling the AddTextEffect method of the
Selection.HeaderFooter.Shapes.

I'm getting this error when trying to call the method:
cannot convert from 'Microsoft.Office.Core.MsoTriState
[####\obj\Debug\Interop.Microsoft.Office.Core.dll]' to
'Microsoft.Office.Core.MsoTriState []'

where "####" is equal to the absolute path of the project.

Here is my latest attempt at getting around this problem:

Word.Selection wSelection = WordDocument.Application.Selection;
object oMissing = System.Reflection.Missing.Value;
Word.Shape wShape;
WordDocument.Sections[1].Range.Select();
Office.MsoTriState _msoFalse =
Microsoft.Office.Core.MsoTriState.msoFalse;
Office.MsoPresetTextEffect _msoTextEffect =
Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1;
WordDocument.ActiveWindow.ActivePane.View.SeekView =
Microsoft.Office.Interop.Word.WdSeekView.wdSeekCurrentPageHeader;
wShape =
wSelection.HeaderFooter.Shapes.AddTextEffect(_msoTextEffect, "TEST TEST
TEST", "Arial", 1, _msoFalse, _msoFalse, 0, 0, ref oMissing);

I have added the MS Office 11.0 com object to my references and
included the using Microsoft.Office.Core statement, any help would be
much appreciated!

Thanks

Gaz
 
G

Gaz

Problem solved, dodgy MS Office installation, I've re-installed Office
and the problem has gone away!

Just thought you may like to know!
Try the Word.vba newsgroup where the VBA gurus usually loiter.

--
Terry Farrell - Word MVP


Garrold said:
Hi,

I'm having a problem calling the AddTextEffect method of the
Selection.HeaderFooter.Shapes.

I'm getting this error when trying to call the method:
cannot convert from 'Microsoft.Office.Core.MsoTriState
[####\obj\Debug\Interop.Microsoft.Office.Core.dll]' to
'Microsoft.Office.Core.MsoTriState []'

where "####" is equal to the absolute path of the project.

Here is my latest attempt at getting around this problem:

Word.Selection wSelection = WordDocument.Application.Selection;
object oMissing = System.Reflection.Missing.Value;
Word.Shape wShape;
WordDocument.Sections[1].Range.Select();
Office.MsoTriState _msoFalse =
Microsoft.Office.Core.MsoTriState.msoFalse;
Office.MsoPresetTextEffect _msoTextEffect =
Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1;
WordDocument.ActiveWindow.ActivePane.View.SeekView =
Microsoft.Office.Interop.Word.WdSeekView.wdSeekCurrentPageHeader;
wShape =
wSelection.HeaderFooter.Shapes.AddTextEffect(_msoTextEffect, "TEST TEST
TEST", "Arial", 1, _msoFalse, _msoFalse, 0, 0, ref oMissing);

I have added the MS Office 11.0 com object to my references and
included the using Microsoft.Office.Core statement, any help would be
much appreciated!

Thanks

Gaz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top