From: Vijayaram B on 31 Dec 2009 01:20 Hi Tony, Thanks for coming closer to the discussion. Can you explain a bit clear how to convert it to bmp. For me bmp format is also ok. "Tony Jollans" wrote: > You might want to take a look at the EnhMetaFileBits property of the page in > the Pages collection - this will not create a jpeg directly (but you can > write a bmp from it), but can be fed to a graphics program for conversion. > > -- > Enjoy, > Tony > > www.WordArticles.com > > "Vijayaram B" <VijayaramB(a)discussions.microsoft.com> wrote in message > news:DDE0502D-4E8B-464A-B0B4-CBE470F686E4(a)microsoft.com... > > Can anyone help me out , > > How to convert the first page of a word document to JPEG image, as we see > > it > > in the print prview window. > > > > Methods tried: Copy Headerfooter and doc content and then read from > > clipboard meta file and finally form a image. > > > > Issues faced: Content may get truncated, or automatically the doc content > > in > > the image get wrapped according to the image size. > > > > Method tried: Document image writer method, > > Issues faced : It has to be installed during office installation itself, > > this is not possible right now, as we don't know who has installed this > > and > > who does not. > > > > May be if i get a freely distributable msi kit for Document image writer > > alone it will be fine. > > > > . >
From: "Tony Jollans" My forename at my surname dot on 31 Dec 2009 11:08 This code does create a bmp file of the page --- but --- it doesn't open in Windows (Vista) default viewer and it takes ages (15 minutes plus on my machine) to open in MS Paint; Snagit, however, opens it in seconds. Sub SavePage() Dim ImageStream ' As ADODB.Stream Dim UserView As WdViewType Application.ScreenUpdating = False UserView = ActiveWindow.View ActiveWindow.View = wdPrintView Set ImageStream = CreateObject("ADODB.Stream") With ImageStream .Type = 1 ' adTypeBinary .Open .Write ActiveWindow.ActivePane.Pages(1).EnhMetaFileBits .SaveToFile "C:\Page.bmp" .Close End With ActiveWindow.View = UserView Set ImageStream = Nothing End Sub You will need a reference to Microsoft ActiveX Data Objects Library, version 2.5 or later, to use early binding and the commented out names. -- Enjoy, Tony www.WordArticles.com "Vijayaram B" <VijayaramB(a)discussions.microsoft.com> wrote in message news:E5EDBA03-E3E3-410A-97C2-0D057E2F5ADA(a)microsoft.com... > Hi Tony, > Thanks for coming closer to the discussion. Can you explain a bit clear > how > to convert it to bmp. For me bmp format is also ok. > > "Tony Jollans" wrote: > >> You might want to take a look at the EnhMetaFileBits property of the page >> in >> the Pages collection - this will not create a jpeg directly (but you can >> write a bmp from it), but can be fed to a graphics program for >> conversion. >> >> -- >> Enjoy, >> Tony >> >> www.WordArticles.com >> >> "Vijayaram B" <VijayaramB(a)discussions.microsoft.com> wrote in message >> news:DDE0502D-4E8B-464A-B0B4-CBE470F686E4(a)microsoft.com... >> > Can anyone help me out , >> > How to convert the first page of a word document to JPEG image, as we >> > see >> > it >> > in the print prview window. >> > >> > Methods tried: Copy Headerfooter and doc content and then read from >> > clipboard meta file and finally form a image. >> > >> > Issues faced: Content may get truncated, or automatically the doc >> > content >> > in >> > the image get wrapped according to the image size. >> > >> > Method tried: Document image writer method, >> > Issues faced : It has to be installed during office installation >> > itself, >> > this is not possible right now, as we don't know who has installed this >> > and >> > who does not. >> > >> > May be if i get a freely distributable msi kit for Document image >> > writer >> > alone it will be fine. >> > >> >> . >>
|
Pages: 1 Prev: Word to Jpeg conversion Next: Unicode text Find & Replace |