Click here to Skip to main content
16,005,121 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: background-image Issue Pin
Brendan Vogt9-May-07 21:04
Brendan Vogt9-May-07 21:04 
AnswerRe: background-image Issue Pin
Guffa10-May-07 5:33
Guffa10-May-07 5:33 
AnswerRe: background-image Issue Pin
N a v a n e e t h9-May-07 16:39
N a v a n e e t h9-May-07 16:39 
QuestionCan i have two Databases for single web application? Pin
SasiP9-May-07 8:37
SasiP9-May-07 8:37 
AnswerRe: Can i have two Databases for single web application? Pin
Colin Angus Mackay9-May-07 11:51
Colin Angus Mackay9-May-07 11:51 
AnswerRe: Can i have two Databases for single web application? Pin
RodEffect9-May-07 13:08
RodEffect9-May-07 13:08 
Questionsharing web pages accross applications Pin
adern9-May-07 7:26
adern9-May-07 7:26 
QuestionIssues in Word Automation Pin
Sankara Narayana9-May-07 4:43
Sankara Narayana9-May-07 4:43 
I was generating a word document with a password set to it from an ASP.NET application...

It was working fine except that a table which is assigned as the header is not correctly getting executed and that the 2 gif images are also not loaded.

The code is.....

wordApp.ActiveWindow.ActivePane.View.[U]SeekView[/U] =
Word.WdSeekView.wdSeekCurrentPageHeader;

if(Convert.ToString(POarray[17]) != "0")
{
object dBehaviour = Word.WdDefaultTableBehavior.wdWord9TableBehavior;
object aBehaviour = Word.WdAutoFitBehavior.wdAutoFitWindow;

Word.Range tableRange = wordApp.Selection.Range;
Word.Table TblPO = wordDoc.Tables.Add(tableRange, 1, 3, ref dBehaviour,
ref aBehaviour);

TblPO.AllowAutoFit = true;
TblPO.TableDirection = Word.WdTableDirection.wdTableDirectionLtr;

TblPO.Columns.PreferredWidth = 10.0f;
TblPO.Cell(0,1).Range.Select();

string picHeaderLeft =
"C:\\InetPub\\WWWroot\\FolderName\\images\\Logo1.gif";

TblPO.Cell(0,1).Range.InlineShapes.AddPicture(picHeaderLeft, ref missing,
ref missing, ref missing);


//The above code in If Block is not getting executed correctly


//Only the following code is executed correctly (the middle cell)
TblPO.Columns.PreferredWidth = 80.0f;
//used setwidth()method...Got an exception
//which i could not resolve...
//And i am Automating Word 2000 (Word 9.0.2720)

TblPO.Cell(0,2).Range.Select();

wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;

//TblPO.Cell(0,2).Range.Font.Size = 11;
//TblPO.Cell(0,2).Range.Font.Name = "Times New Roman";

string file = Convert.ToString(POarray[17]); // FilePath

TblPO.Cell(0,2).Range.InsertFile( file, ref missing, ref missing, ref missing, ref missing );
// The file got inserted correctly to the document as header
// Meaning TblPO is active in memory

// Again the following code is not getting executed properly
TblPO.Columns.PreferredWidth = 10.0f;
TblPO.Cell(0,3).Range.Select();

string picHeaderRight
= "C:\\InetPub\\WWWroot\\FolderName\\images\\Logo2.gif";

TblPO.Cell(0,3).Range.InlineShapes.AddPicture(picHeaderRight, ref missing,
ref missing,ref missing);
}

The code snippet continues as...

wordApp.Selection.TypeParagraph();
wordApp.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekMainDocument;

wordApp.Selection.TypeParagraph();

wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;

wordApp.Selection.Font.Bold = 1;
wordApp.Selection.Font.Underline = Word.WdUnderline.wdUnderlineSingle;

wordApp.Selection.Font.Name = "Times New Roman";
wordApp.Selection.Font.Size = 12;
wordApp.Selection.TypeText("Heading");

I heve checked up the code with breakpoints...But surprisingly it is not entering that "if " statement itself...It was jumping to a statement way
after wordApp.Selection.TypeText("Heading"), after it has executed SeekView statement.

Before also i had problems with breakpoints....Some times it will not enter to this class itself...

As this code is executed in Word(Unmanaged code) and not in CLR...I think inconsistancies can happen.....

I also had problems with solution....Changes not getting reflected in the solution even after building...In .NET is there versioning for solution ?

Please help....

I have no idea why it is behaving like this....
QuestionError using System.Configuration.NameValueSectionHandler Pin
bensalins9-May-07 4:08
bensalins9-May-07 4:08 
QuestionApplying stylesheet to ajax autocompleteextender [modified] Pin
Sandeep_Kumbhar9-May-07 2:36
Sandeep_Kumbhar9-May-07 2:36 
QuestionRandom Draw Pin
Sam Heller9-May-07 2:23
Sam Heller9-May-07 2:23 
AnswerRe: Random Draw Pin
Tarakeshwar Reddy9-May-07 3:14
professionalTarakeshwar Reddy9-May-07 3:14 
GeneralRe: Random Draw Pin
Sam Heller9-May-07 3:25
Sam Heller9-May-07 3:25 
GeneralRe: Random Draw Pin
Tarakeshwar Reddy9-May-07 3:32
professionalTarakeshwar Reddy9-May-07 3:32 
GeneralRe: Random Draw Pin
Sam Heller9-May-07 3:33
Sam Heller9-May-07 3:33 
GeneralRe: Random Draw Pin
Tarakeshwar Reddy9-May-07 3:45
professionalTarakeshwar Reddy9-May-07 3:45 
QuestionHow to get a PopUp Pin
Spunky Coder9-May-07 2:05
Spunky Coder9-May-07 2:05 
AnswerRe: How to get a PopUp Pin
varshavmane9-May-07 2:26
varshavmane9-May-07 2:26 
AnswerRe: How to get a PopUp Pin
varshavmane9-May-07 2:28
varshavmane9-May-07 2:28 
QuestionASP Grid Pin
speedy_gonzalas9-May-07 2:04
speedy_gonzalas9-May-07 2:04 
AnswerRe: ASP Grid Pin
varshavmane9-May-07 2:20
varshavmane9-May-07 2:20 
GeneralRe: ASP Grid Pin
speedy_gonzalas9-May-07 18:32
speedy_gonzalas9-May-07 18:32 
GeneralRe: ASP Grid Pin
varshavmane9-May-07 20:06
varshavmane9-May-07 20:06 
GeneralRe: ASP Grid Pin
speedy_gonzalas9-May-07 20:13
speedy_gonzalas9-May-07 20:13 
GeneralRe: ASP Grid Pin
varshavmane9-May-07 20:34
varshavmane9-May-07 20:34 

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.