Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 03-26-2014, 07:36 PM   #1
spacemaster
Junior Member
spacemaster began at the beginning.
 
spacemaster's Avatar
 
Posts: 7
Karma: 10
Join Date: Mar 2014
Location: In my dreams
Device: iPad 2
Macro to save pictures from Word 2010

Hi guys,
I would like to ask if someone has or is capable of writing a simple macro that would take a picture from Word document and save it in the same folder where the document is and with the same name.
I know that Word 2010 has the possibility of saving the picture via context menu but it doesn't seems to remember the saving location so every time I do this I need to choose the path again and write the name. You might think I am too lazy but if you do this for every .doc ebook to convert it into .epub it's real pain in the a*se.
So ideally it should work like this:
I open the document .doc, click the picture, start macro, and macro saves the picture to the folder where the document is with the same name as the document a than delete the picture.
Hope you understand me and I don't waste you time.
Thanks a lot
spacemaster is offline   Reply With Quote
Old 03-27-2014, 01:03 AM   #2
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,596
Karma: 14407089
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Sorry, but:

why don't you just "save as...filtered HTML" and use the instantly-created folder of images that comes along with the HTML file, which is pretty much exactly what you just asked for? No macro, no muss, no fuss, no hassle?

Hitch
Hitch is offline   Reply With Quote
Old 03-27-2014, 03:26 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,104
Karma: 5861069
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Hitch is right. Although the option to save pictures from Word is now possible by right-clicking on them, this functionality is not ported to VBA or .NET. So, it is not possible to do with macro's or programming.
The best option would be to retreive the original pictures, since Word does some manhandling of pictures which lowers the quality. If that is not possible, you are best of saving as (filtered) HTML and have all the pictures neatly in the appropiate folder. Another option is to copy the picture and past it into a image editor and the last option is to grab the image from the word document and put it in a bitmap element in a macro/program and save that one. However, that has also several issues.

I investigated this issue at length in the past for both my macro and my program. In the end I never got it fully to work in a macro. The save as (filtered) HTML is your best option.
Toxaris is offline   Reply With Quote
Old 03-28-2014, 06:24 AM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,596
Karma: 14407089
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by Toxaris View Post
Hitch is right. Although the option to save pictures from Word is now possible by right-clicking on them, this functionality is not ported to VBA or .NET. So, it is not possible to do with macro's or programming.
The best option would be to retreive the original pictures, since Word does some manhandling of pictures which lowers the quality. If that is not possible, you are best of saving as (filtered) HTML and have all the pictures neatly in the appropiate folder. Another option is to copy the picture and past it into a image editor and the last option is to grab the image from the word document and put it in a bitmap element in a macro/program and save that one. However, that has also several issues.

I investigated this issue at length in the past for both my macro and my program. In the end I never got it fully to work in a macro. The save as (filtered) HTML is your best option.
Given that "save as HTML, filtered," will output all the images exactly as the OP wanted, and takes about 30 seconds, really, I think creating a macro is overkill. Maybe he can create a script with AHK_L or ??? to open a Word file, and "save as..." if he's doing a lot of conversions, but...seriously, that sounds like a gigantic time-waster to me. Make-work, effectively.

BUT, that's just my $.02.

Hitch
Hitch is offline   Reply With Quote
Old 03-28-2014, 07:04 AM   #5
spacemaster
Junior Member
spacemaster began at the beginning.
 
spacemaster's Avatar
 
Posts: 7
Karma: 10
Join Date: Mar 2014
Location: In my dreams
Device: iPad 2
Quote:
Originally Posted by Hitch View Post
Given that "save as HTML, filtered," will output all the images exactly as the OP wanted, and takes about 30 seconds, really, I think creating a macro is overkill. Maybe he can create a script with AHK_L or ??? to open a Word file, and "save as..." if he's doing a lot of conversions, but...seriously, that sounds like a gigantic time-waster to me. Make-work, effectively.

BUT, that's just my $.02.

Hitch
Well I wanted to created a macro because when I convert lots of .doc documents with pictures it's really annoying to choose the path every time I want to save picture.
I do it like this: get a .doc document containing book itself and cover picture. I save the picture so I can later use it as cover picture in calibre and then use a macro that saves the document as .rtf. Rtf documents then upload to calibre, convert to epub and add the extracted cover picture. And the process of extracting picturec takes the longest time. And since I have a lot of books in .doc (Perry Rhodan series) it takes a lot of time.
So there is really no way of using macros to save pictures from document? Or is there any better way to do what I described earlier? I learned it myself so it's probably not the fastest way or the smartest way but it worked so far for me.
spacemaster is offline   Reply With Quote
Old 03-28-2014, 01:02 PM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,104
Karma: 5861069
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
What I described are the only ways, sorry about that. They haven't opened up the 'save picture' api yet like I said. Nor in VBA, nor in .NET.

You could also open the .docx in for example 7-zip and extract the images.
Toxaris is offline   Reply With Quote
Old 03-28-2014, 02:16 PM   #7
spacemaster
Junior Member
spacemaster began at the beginning.
 
spacemaster's Avatar
 
Posts: 7
Karma: 10
Join Date: Mar 2014
Location: In my dreams
Device: iPad 2
Hope they will make that option available... But thank you for your time
spacemaster is offline   Reply With Quote
Old 03-28-2014, 06:47 PM   #8
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,596
Karma: 14407089
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by spacemaster View Post
Hope they will make that option available... But thank you for your time
I must be losing touch with time. I thought that the Perry Rhodan series was still under copyright and available in print.

Hitch
Hitch is offline   Reply With Quote
Old 03-29-2014, 02:48 AM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,104
Karma: 5861069
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Quote:
Originally Posted by Hitch View Post
I must be losing touch with time. I thought that the Perry Rhodan series was still under copyright and available in print.

Hitch
It is. It is a running series AFAK. I do know there are a lot of Word documents with episodes flying around the net.
Toxaris is offline   Reply With Quote
Old 03-29-2014, 07:01 AM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,596
Karma: 14407089
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by Toxaris View Post
It is. It is a running series AFAK. I do know there are a lot of Word documents with episodes flying around the net.
Mmmmm.

Hitch
Hitch is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro for clean HTML code Toxaris ePub 133 08-08-2014 07:13 AM
Word Macro: Footnotes to inline text ? Hadrien Workshop 17 10-08-2011 02:28 PM
Word 2007 macro scoplar Workshop 1 05-21-2011 06:00 AM
Doc to REB Macro for Word kbirdz Fictionwise eBookwise 0 10-27-2010 11:30 PM
Word Formatting Macro (Stingo's Macro) Stingo Sony Reader 75 08-24-2010 06:18 AM


All times are GMT -4. The time now is 08:37 PM.


MobileRead.com is a privately owned, operated and funded community.