Click here to Skip to main content
15,860,859 members
Home / Discussions / COM
   

COM

 
QuestionIHTMLElement2 functions crash in IE7 when scrolling browser control programmatically Pin
castielle_alana15-Oct-10 1:38
castielle_alana15-Oct-10 1:38 
AnswerRe: IHTMLDocument2 functions crash in IE7 when scrolling browser control programmatically Pin
castielle_alana15-Oct-10 1:44
castielle_alana15-Oct-10 1:44 
QuestionCoInitialize return code Pin
alex__b14-Oct-10 23:30
professionalalex__b14-Oct-10 23:30 
AnswerRe: CoInitialize return code [modified] Pin
Sauro Viti14-Oct-10 23:46
professionalSauro Viti14-Oct-10 23:46 
GeneralRe: CoInitialize return code Pin
alex__b15-Oct-10 0:05
professionalalex__b15-Oct-10 0:05 
QuestionInvoke methods in OCX in c# Pin
Viratsaran11-Oct-10 20:18
Viratsaran11-Oct-10 20:18 
AnswerRe: Invoke methods in OCX in c# Pin
«_Superman_»13-Oct-10 20:31
professional«_Superman_»13-Oct-10 20:31 
QuestionConvert document to PDF format Pin
hemananthan15-Sep-10 19:29
hemananthan15-Sep-10 19:29 
Can anybody help me programatically using COM components to get the solution for converting any type of document to PDF format
we already tried through this coding:

public static void ConverWordToPDF(string Filepath, string Targetpath)
{

object Unknown = Type.Missing;
object Source = Filepath;
object Target = Targetpath;

ApplicationClass MSdoc = new ApplicationClass();

try
{

MSdoc.Visible = false;
MSdoc.Documents.Open(ref Source, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown);
MSdoc.Application.Visible = false;
MSdoc.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateMinimize;

object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF;

MSdoc.ActiveDocument.SaveAs(ref Target, ref format,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown);
}
catch (Exception e)
{
log.Info("Converted Word to PDF", e);

}
finally
{
if (MSdoc != null)
{
MSdoc.Documents.Close(ref Unknown, ref Unknown, ref Unknown);

}

MSdoc.Quit(ref Unknown, ref Unknown, ref Unknown);
}
}
Normally in while runing this application in local its working fine in XP System:
while run through IIS i getting the following error:
System.Runtime.InteropServices.COMException (0x800A11FD):
===================
System.Runtime.InteropServices.COMException (0x800A11FD):
This method or property is not available because a document window is not active.

at Microsoft.Office.Interop.Word.Documents.Close(Object& SaveChanges,
Object& OriginalFormat, Object& RouteDocument)
Can anybody suggest me how to resolve it or any new solution for conversion process
Thanks

Regards
Hemananthan>S

AnswerRe: Convert document to PDF format Pin
Member 45243333-Jul-11 22:40
Member 45243333-Jul-11 22:40 
GeneralRe: Convert document to PDF format Pin
Nitin K. Kawale12-Jul-11 0:34
professionalNitin K. Kawale12-Jul-11 0:34 
QuestionGetting an access to idispatch member of idispatch interface Pin
Altankhuu11-Sep-10 21:25
Altankhuu11-Sep-10 21:25 
AnswerRe: Getting an access to idispatch member of idispatch interface Pin
«_Superman_»12-Sep-10 19:21
professional«_Superman_»12-Sep-10 19:21 
GeneralRe: Getting an access to idispatch member of idispatch interface Pin
Altankhuu19-Sep-10 21:56
Altankhuu19-Sep-10 21:56 
AnswerRe: Getting an access to idispatch member of idispatch interface Pin
Lim Bio Liong26-Oct-10 1:38
Lim Bio Liong26-Oct-10 1:38 
QuestionreportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) [modified] Pin
amitcoder836-Sep-10 17:54
amitcoder836-Sep-10 17:54 
AnswerCrosspost - ignore Pin
Richard MacCutchan6-Sep-10 21:37
mveRichard MacCutchan6-Sep-10 21:37 
QuestionHow to send NULL to a IUnknown** parameter when COM object is surrogate hosted Pin
Per Nilsson2-Sep-10 19:58
Per Nilsson2-Sep-10 19:58 
AnswerRe: How to send NULL to a IUnknown** parameter when COM object is surrogate hosted Pin
tolw2-Sep-10 20:33
tolw2-Sep-10 20:33 
GeneralRe: How to send NULL to a IUnknown** parameter when COM object is surrogate hosted Pin
Per Nilsson2-Sep-10 20:42
Per Nilsson2-Sep-10 20:42 
AnswerRe: How to send NULL to a IUnknown** parameter when COM object is surrogate hosted [modified] Pin
tolw2-Sep-10 21:16
tolw2-Sep-10 21:16 
GeneralRe: How to send NULL to a IUnknown** parameter when COM object is surrogate hosted Pin
Per Nilsson2-Sep-10 23:07
Per Nilsson2-Sep-10 23:07 
QuestionWSACancelBlockingCall Pin
Bedke2-Sep-10 1:51
Bedke2-Sep-10 1:51 
QuestionHow to deal with such situation?(Need pass STL vector to dll under vs2008) [modified] Pin
fantasy121523-Aug-10 17:04
fantasy121523-Aug-10 17:04 
AnswerRe: How to deal with such situation?(Need pass STL vector to dll under vs2008) Pin
KingsGambit23-Aug-10 21:00
KingsGambit23-Aug-10 21:00 
QuestionQuestion about IOleObject::GetClipboardData Pin
edward barbu18-Aug-10 0:51
edward barbu18-Aug-10 0:51 

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.