View Full Version : Office 2007 to PDF


Lit
05-31-2006, 06:17 PM
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

Alvin Bruney
05-31-2006, 08:58 PM
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
-------------------------------------------------------

"Lit" <sql_agentman@hotmail.com> wrote in message
news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
> 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
>

Lit
05-31-2006, 10:40 PM
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
news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
> 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
> -------------------------------------------------------
>
> "Lit" <sql_agentman@hotmail.com> wrote in message
> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>> 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
>>
>
>

Alvin Bruney
06-01-2006, 02:40 AM
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
-------------------------------------------------------

"Lit" <sql_agentman@hotmail.com> wrote in message
news:eWyNLrPhGHA.1864@TK2MSFTNGP02.phx.gbl...
> 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
> news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
>> 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
>> -------------------------------------------------------
>>
>> "Lit" <sql_agentman@hotmail.com> wrote in message
>> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>>> 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
>>>
>>
>>
>
>

Josh Sale
06-01-2006, 04:07 PM
Actually PDF support is built-in with Office 2007. I suggest you turn on
the macro recorder and then open your document and then save it as a PDF
file and then see what gets recorded.

josh

Lit
06-01-2006, 06:05 PM
Josh,

Good Idea.

Does this record in VBA?
So what you are saying then I can do this eventually in C# or VB.NET

Lit

"Josh Sale" <jsale@tril dot cod> wrote in message
news:%23ZcYo0YhGHA.2208@TK2MSFTNGP05.phx.gbl...
> Actually PDF support is built-in with Office 2007. I suggest you turn on
> the macro recorder and then open your document and then save it as a PDF
> file and then see what gets recorded.
>
> josh
>

Lit
06-01-2006, 06:06 PM
Alvin,

Thanks hope to hear from you good news.

Lit

"Alvin Bruney" <www.lulu.com/owc> wrote in message
news:%23fqMdxRhGHA.4712@TK2MSFTNGP05.phx.gbl...
> 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
> -------------------------------------------------------
>
> "Lit" <sql_agentman@hotmail.com> wrote in message
> news:eWyNLrPhGHA.1864@TK2MSFTNGP02.phx.gbl...
>> 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
>> news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
>>> 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
>>> -------------------------------------------------------
>>>
>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>

Josh Sale
06-01-2006, 06:31 PM
Yes, it will record a VBA macro which you can then inspect to see how it
manipulates the Office object model.

I'm not sure what your development environment is (VSTO?) but the object
model is common across all of the environments (VBA, VSTO, etc) even if the
language details are different.

BTW, I was able to record a the publication of an Excel workbook into PDF
using Excel's macro recorder so I don't see why the same thing wouldn't work
with Word.

josh




"Lit" <sql_agentman@hotmail.com> wrote in message
news:OyI3K2ZhGHA.4648@TK2MSFTNGP02.phx.gbl...
> Josh,
>
> Good Idea.
>
> Does this record in VBA?
> So what you are saying then I can do this eventually in C# or VB.NET
>
> Lit
>
> "Josh Sale" <jsale@tril dot cod> wrote in message
> news:%23ZcYo0YhGHA.2208@TK2MSFTNGP05.phx.gbl...
>> Actually PDF support is built-in with Office 2007. I suggest you turn on
>> the macro recorder and then open your document and then save it as a PDF
>> file and then see what gets recorded.
>>
>> josh
>>
>
>

Alvin Bruney
06-01-2006, 07:02 PM
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" <sql_agentman@hotmail.com> wrote in message
news:erMru2ZhGHA.1520@TK2MSFTNGP03.phx.gbl...
> Alvin,
>
> Thanks hope to hear from you good news.
>
> Lit
>
> "Alvin Bruney" <www.lulu.com/owc> wrote in message
> news:%23fqMdxRhGHA.4712@TK2MSFTNGP05.phx.gbl...
>> 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
>> -------------------------------------------------------
>>
>> "Lit" <sql_agentman@hotmail.com> wrote in message
>> news:eWyNLrPhGHA.1864@TK2MSFTNGP02.phx.gbl...
>>> 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
>>> news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
>>>> 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
>>>> -------------------------------------------------------
>>>>
>>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>>> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Lit
06-01-2006, 09:47 PM
Alvin,

First Thank you for the code that was a very good start for me. However,

I tested the code you provided but with an existing document and I did not
get the results I wanted.
I have a srcDoc ="myTestDoc.docx"
I asked to save srcDoc as PDF and the result file was corrupt.

The thing is I need to be able to tell Word2007 to Export or To save as PDF
Format.

I don't know what to substitute for "Missing" object you have below.

I recorded a MACRO to save as PDF and it has the following :

Sub Macro1()
'
' Macro1 Macro
'
ActiveDocument.ExportAsFixedFormat _
OutputFileName:= "C:\\dstDoc.pdf" _
, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False,
OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1,
To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True,
_
CreateBookmarks:=wdExportCreateNoBookmarks
ChangeFileOpenDirectory "C:\test\"

End Sub

I don't know how to translate some of the parameters like
ExportFormat:=wdExportFormatPDF etc.. etc... etc...

Thanks Alvin.

Lit



"Alvin Bruney" <www.lulu.com/owc> wrote in message
news:%23TbzeWahGHA.1204@TK2MSFTNGP02.phx.gbl...
> 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" <sql_agentman@hotmail.com> wrote in message
> news:erMru2ZhGHA.1520@TK2MSFTNGP03.phx.gbl...
>> Alvin,
>>
>> Thanks hope to hear from you good news.
>>
>> Lit
>>
>> "Alvin Bruney" <www.lulu.com/owc> wrote in message
>> news:%23fqMdxRhGHA.4712@TK2MSFTNGP05.phx.gbl...
>>> 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
>>> -------------------------------------------------------
>>>
>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>> news:eWyNLrPhGHA.1864@TK2MSFTNGP02.phx.gbl...
>>>> 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
>>>> news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
>>>>> 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
>>>>> -------------------------------------------------------
>>>>>
>>>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>>>> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Lit
06-01-2006, 09:56 PM
Alvin,

Okay I have to use the Export as the MACRO did and it works
doc.ExportAsFixedFormat("c:\dstDoc.pd", etc.. ) VS.NET 2003 give me all
the Intellisence I needed.

Thank you

Lit


"Lit" <sql_agentman@hotmail.com> wrote in message
news:uHwEmybhGHA.4368@TK2MSFTNGP03.phx.gbl...
> Alvin,
>
> First Thank you for the code that was a very good start for me. However,
>
> I tested the code you provided but with an existing document and I did not
> get the results I wanted.
> I have a srcDoc ="myTestDoc.docx"
> I asked to save srcDoc as PDF and the result file was corrupt.
>
> The thing is I need to be able to tell Word2007 to Export or To save as
> PDF Format.
>
> I don't know what to substitute for "Missing" object you have below.
>
> I recorded a MACRO to save as PDF and it has the following :
>
> Sub Macro1()
> '
> ' Macro1 Macro
> '
> ActiveDocument.ExportAsFixedFormat _
> OutputFileName:= "C:\\dstDoc.pdf" _
> , ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False,
> OptimizeFor:= _
> wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1,
> To:=1, _
> Item:=wdExportDocumentContent, IncludeDocProps:=True,
> KeepIRM:=True, _
> CreateBookmarks:=wdExportCreateNoBookmarks
> ChangeFileOpenDirectory "C:\test\"
>
> End Sub
>
> I don't know how to translate some of the parameters like
> ExportFormat:=wdExportFormatPDF etc.. etc... etc...
>
> Thanks Alvin.
>
> Lit
>
>
>
> "Alvin Bruney" <www.lulu.com/owc> wrote in message
> news:%23TbzeWahGHA.1204@TK2MSFTNGP02.phx.gbl...
>> 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" <sql_agentman@hotmail.com> wrote in message
>> news:erMru2ZhGHA.1520@TK2MSFTNGP03.phx.gbl...
>>> Alvin,
>>>
>>> Thanks hope to hear from you good news.
>>>
>>> Lit
>>>
>>> "Alvin Bruney" <www.lulu.com/owc> wrote in message
>>> news:%23fqMdxRhGHA.4712@TK2MSFTNGP05.phx.gbl...
>>>> 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
>>>> -------------------------------------------------------
>>>>
>>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>>> news:eWyNLrPhGHA.1864@TK2MSFTNGP02.phx.gbl...
>>>>> 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
>>>>> news:uTnkdyOhGHA.4276@TK2MSFTNGP03.phx.gbl...
>>>>>> 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
>>>>>> -------------------------------------------------------
>>>>>>
>>>>>> "Lit" <sql_agentman@hotmail.com> wrote in message
>>>>>> news:%23VhUKYNhGHA.2188@TK2MSFTNGP04.phx.gbl...
>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Lit
06-01-2006, 10:39 PM
Josh,

Recording a MACRO was a very good Idea so Office 2007 tells me what to do.

I can not find out what to put for Parameters at times because VS.NET 2003
does not give me the Intellisence I need.
Can not find a doc to tell me what the Enums are...

Thank you again,

Lit


"Josh Sale" <jsale@tril dot cod> wrote in message
news:uuhYgEahGHA.4776@TK2MSFTNGP05.phx.gbl...
> Yes, it will record a VBA macro which you can then inspect to see how it
> manipulates the Office object model.
>
> I'm not sure what your development environment is (VSTO?) but the object
> model is common across all of the environments (VBA, VSTO, etc) even if
> the language details are different.
>
> BTW, I was able to record a the publication of an Excel workbook into PDF
> using Excel's macro recorder so I don't see why the same thing wouldn't
> work with Word.
>
> josh
>
>
>
>
> "Lit" <sql_agentman@hotmail.com> wrote in message
> news:OyI3K2ZhGHA.4648@TK2MSFTNGP02.phx.gbl...
>> Josh,
>>
>> Good Idea.
>>
>> Does this record in VBA?
>> So what you are saying then I can do this eventually in C# or VB.NET
>>
>> Lit
>>
>> "Josh Sale" <jsale@tril dot cod> wrote in message
>> news:%23ZcYo0YhGHA.2208@TK2MSFTNGP05.phx.gbl...
>>> Actually PDF support is built-in with Office 2007. I suggest you turn
>>> on the macro recorder and then open your document and then save it as a
>>> PDF file and then see what gets recorded.
>>>
>>> josh
>>>
>>
>>
>
>