This appears to work. Note, I had several problems with file corruption,
shared files and the like, but this should give you a good starting point
private void button1_Click(object sender, EventArgs e)
{
object Missing = System.Reflection.Missing.Value;
object newDoc = "c:\\mypdf.pdf";
Word.Application app = new Word.ApplicationClass();
Word.Document doc = new Word.Document();
doc = ThisApplication.Documents.Open(ref newDoc,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing);
doc.Paragraphs[1].Range.Text = "this is new pdf text";
doc.SaveAs(ref newDoc,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing);
}
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog:
http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
Lit said:
Alvin,
Thanks hope to hear from you good news.
Lit
"Alvin Bruney" <
www.lulu.com/owc> wrote in message
I've been pouring over the literature for the last hour or so and I
can't find the API. Either I haven't looked well enough on the WordAPI
model or it isn't there. I'll keep it on my list of things to research.
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog:
http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
Alvin,
If you can saveAs PDF why can't I programmatically open a document and
save it as pdf??
From what I heard the in office 12 Microsoft opened up the API fro PDF
generation.
Lit
"Alvin Bruney" <
www.lulu.com/owc> wrote in message
pdf's aren't built in, you'd need a 3rd party app for this. It isn't
to late to have your say either if you want this supported in the
release version.
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog:
http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
Hello,
I am using VS.NET 2005, C# or VB.NET
Does anyone know how to programmatically open a word doc and save it
as PDF in office 12 2007 Beta?
Thanks for any Links, code, etc..
O