Thursday, December 17, 2009

Hathway issues

Few tips and solutions to hathway users:
1) Internet stops working if you change machine.
If you have configured internet to work with one PC/laptop. and its working fine.
and One fine day, you got extra laptop or some friends comes and wants to connect to
internet using his laptop. internet stops working. Sometime if you reboot router,
internet will stop working on either of machine.
This is big headache.
Solution: Call hathway CC, tell them clearly that internet is not working as you changed your laptop. then they will do some reset from their side, and It works like magic, thing starts working on new laptop.

2) Configuring Router:
Better solution is get LinkSys Router and configure it. even if before configuring it, you need to ask hathway people to reset your connection.
There is no direct way to check if router is connected to internet or not, but it should set it as DHCP. it will pick up IP address and status will show UP(DHCP) under WAN.
if its not working after acquiring ip address. go to advance setup->advance routing , select Current mode as Gateway.

feel free to ask if its not working for you.

Wednesday, December 02, 2009

Automating MS Word

I was trying to fix a bug related to handling a windows document from ASP.net/C#/Windows Server 2003 program.
Some things I had issues and resolved.
1) Access Denied: Microsoft.Office.Interop.Word
Give access to Network Service to refered dll which should be Microsoft.Office.Interop.Word.dll
2) Removing existing watermark from file programmatically.
doc.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekCurrentPageHeader;

foreach(Word.Shape s in doc.Application.Selection.HeaderFooter.Shapes ){
Logger.Write(s.Name);
if (s.Name.Length > 24 && s.Name.Substring(0, 24) == "PowerPlusWaterMarkObject") {
s.Delete();
}
}
doc.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekMainDocument;


3) Memory issues
You will notice Winword.exe in TaskManager. which opens after each operation.
better refer following discussion at Stackoverflow.
ASP.net C# - WINWORD.exe