Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Convert HtmlData to String Pin
VenkataRamana.Gali24-Apr-06 10:17
VenkataRamana.Gali24-Apr-06 10:17 
GeneralRe: How to Convert HtmlData to String Pin
Judah Gabriel Himango24-Apr-06 10:25
sponsorJudah Gabriel Himango24-Apr-06 10:25 
GeneralRe: How to Convert HtmlData to String Pin
Tom Larsen24-Apr-06 10:50
Tom Larsen24-Apr-06 10:50 
AnswerRe: How to Convert HtmlData to String Pin
Ravi Bhavnani24-Apr-06 10:48
professionalRavi Bhavnani24-Apr-06 10:48 
GeneralRe: How to Convert HtmlData to String Pin
VenkataRamana.Gali24-Apr-06 11:47
VenkataRamana.Gali24-Apr-06 11:47 
GeneralRe: How to Convert HtmlData to String Pin
Ravi Bhavnani24-Apr-06 11:55
professionalRavi Bhavnani24-Apr-06 11:55 
GeneralRe: How to Convert HtmlData to String Pin
VenkataRamana.Gali25-Apr-06 2:34
VenkataRamana.Gali25-Apr-06 2:34 
QuestionC# MS Word Watermark Pin
tartancli24-Apr-06 9:20
tartancli24-Apr-06 9:20 
Hi,

I'm trying to insert a watermark witha a Word Add-in. I'm using a variant
of Paul Stubbs code that i found from a Google. The method I'm using is as
follows:

private void addWatermark(Word.Document doc, string WatermarkText)
{

doc.Application.ActiveWindow.View.Type = Word.WdViewType.wdPrintView;

doc.Sections[1].Range.Select();
doc.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekCurrentPageHeader;

Word.Selection Selection = doc.Application.Selection;
Word.Shape wmShape;

//Create the watermark shape
Object missing = Type.Missing;
wmShape = Selection.HeaderFooter.Shapes.AddTextEffect(
Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1,
WatermarkText, "Times New Roman", 1,
Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoFalse,
0, 0, ref missing);

//Set all of the attributes of the watermark

wmShape.Select(ref missing);
wmShape.Name = "PowerPlusWaterMarkObject1";
wmShape.TextEffect.NormalizedHeight =
Microsoft.Office.Core.MsoTriState.msoFalse;
wmShape.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
wmShape.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
wmShape.Fill.Solid();
wmShape.Fill.ForeColor.RGB = (int)Word.WdColor.wdColorGray25;
wmShape.Fill.Transparency = 0.5f;
wmShape.Rotation = 315.0f;
wmShape.LockAspectRatio = Microsoft.Office.Core.MsoTriState.msoTrue;
wmShape.Height = doc.Application.InchesToPoints(2.82f);
wmShape.Width = doc.Application.InchesToPoints(5.64f);
/*
wmShape.WrapFormat.AllowOverlap = -1; //true
wmShape.WrapFormat.Side = Word.WdWrapSideType.wdWrapBoth;
wmShape.WrapFormat.Type = Word.WdWrapType.wdWrapNone; //3#
*/
wmShape.RelativeHorizontalPosition =
Word.WdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;
wmShape.RelativeVerticalPosition =
Word.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;
wmShape.Left = (float)Word.WdShapePosition.wdShapeCenter;
wmShape.Top = (float)Word.WdShapePosition.wdShapeCenter;

//set focus back to document
doc.Application.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekMainDocument;

} // end addWatermark

The problem i have is that I get an exception at line:
wmShape.WrapFormat.AllowOverlap = -1;

this excpetion indicated that the method or property is not available
because the drawing operation cannot be applied to the current selection?????

Any help greatly appreciated!!! Thnx, tc
QuestionMysterious error dialog on exit.... Pin
CherezZaboro24-Apr-06 7:49
CherezZaboro24-Apr-06 7:49 
AnswerRe: Mysterious error dialog on exit.... Pin
mav.northwind24-Apr-06 8:14
mav.northwind24-Apr-06 8:14 
GeneralRe: Mysterious error dialog on exit.... Pin
CherezZaboro25-Apr-06 8:51
CherezZaboro25-Apr-06 8:51 
AnswerRe: Mysterious error dialog on exit.... Pin
Tom Larsen24-Apr-06 10:44
Tom Larsen24-Apr-06 10:44 
GeneralRe: Mysterious error dialog on exit.... Pin
CherezZaboro25-Apr-06 8:52
CherezZaboro25-Apr-06 8:52 
AnswerRe: Mysterious error dialog on exit.... Pin
Graham Nimbley24-Apr-06 13:19
Graham Nimbley24-Apr-06 13:19 
AnswerRe: Mysterious error dialog on exit.... Pin
cmaissan24-Apr-06 17:40
cmaissan24-Apr-06 17:40 
GeneralRe: Mysterious error dialog on exit.... Pin
alexey N24-Apr-06 18:23
alexey N24-Apr-06 18:23 
AnswerRe: Mysterious error dialog on exit.... Pin
alexey N24-Apr-06 18:32
alexey N24-Apr-06 18:32 
GeneralRe: Mysterious error dialog on exit.... Pin
CherezZaboro25-Apr-06 8:54
CherezZaboro25-Apr-06 8:54 
Questionhow create a xor bar? Pin
Susuko24-Apr-06 7:31
Susuko24-Apr-06 7:31 
AnswerRe: how create a xor bar? Pin
Josh Smith24-Apr-06 7:36
Josh Smith24-Apr-06 7:36 
GeneralRe: how create a xor bar? Pin
Susuko24-Apr-06 9:00
Susuko24-Apr-06 9:00 
GeneralRe: how create a xor bar? Pin
Josh Smith24-Apr-06 9:13
Josh Smith24-Apr-06 9:13 
QuestionUnable to cast object of type 'X' to type 'X' Pin
Pink Floyd24-Apr-06 6:46
Pink Floyd24-Apr-06 6:46 
AnswerRe: Unable to cast object of type 'X' to type 'X' Pin
Josh Smith24-Apr-06 7:04
Josh Smith24-Apr-06 7:04 
GeneralRe: Unable to cast object of type 'X' to type 'X' Pin
Pink Floyd24-Apr-06 8:10
Pink Floyd24-Apr-06 8:10 

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.