Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2015, 06:35 PM
Lakeland Lakeland is offline How to use VBA to extract picasa photo captions and tags? Windows 7 64bit How to use VBA to extract picasa photo captions and tags? Office 2010 32bit
Novice
How to use VBA to extract picasa photo captions and tags?
 
Join Date: Feb 2015
Location: Canada
Posts: 2
Lakeland is on a distinguished road
Default How to use VBA to extract picasa photo captions and tags?

I wanted to insert photos in word document with word VBA using the codes below:

Sub BulkInsertPictures()



'!!! ADD A REFERENCE TO THE
'!!! Mircosoft Scripting Runtime
'!!! from Tools>References

Dim fso As FileSystemObject
Dim fldr As Folder
Dim f As File
Dim myNewPic As InlineShape
Dim scale_factor As Long

'set constants for max width of pictures
'and the path of the target folder
Const max_width As Long = 100
Const pic_path As String = "C:\TEMP"

Set fso = New FileSystemObject
'set up the target folder
Set fldr = fso.GetFolder(pic_path)

'loop through all the files in the target folder
For Each f In fldr.Files
'check file extension
If LCase(Right(f.Name, 3)) = "jpg" Then
'add picture
Set myNewPic = Selection.InlineShapes.AddPicture( _
f.Path, False, True)
'check size and scale if too big
If myNewPic.Width > max_width Then
scale_factor = (max_width / myNewPic.Width) * 100
myNewPic.ScaleWidth = scale_factor
myNewPic.ScaleHeight = scale_factor
End If
Selection.TypeParagraph
Selection.InsertCaption Label:="Figure", TitleAutoText:="", _
Title:=": " & f.Name, Position:=wdCaptionPositionBelow
Selection.TypeParagraph
End If
Next

End Sub


The code can be found here:

http://www.vbaexpress.com/forum/arch...hp/t-6100.html

Is there any way to use VBA to extgract picasa photo captions and tags and put them in the word document?

Thanks in advance!
Reply With Quote
  #2  
Old 06-05-2015, 10:11 PM
macropod's Avatar
macropod macropod is offline How to use VBA to extract picasa photo captions and tags? Windows 7 64bit How to use VBA to extract picasa photo captions and tags? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your link doesn't work. However, I have posted code in the past for inserting multiple pictures into a document with captions. See, for example: https://www.msofficeforums.com/word/...html#post78488
Whether the photo captions and tags to which you refer could be extracted and inserted into the document as part of such a process depends on where those data are stored. If the images are in the jpg format, for example, the captions and tags may be stored as part of the image metadata, which means code that reads the metadata could be used to extract them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
caption, photo



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use VBA to extract picasa photo captions and tags? VBA to insert captions without appending to existing captions Marrick13 Word VBA 17 03-21-2023 07:51 PM
Is there a way to find tags in iOS OneNote apps JohannesStahl OneNote 0 02-19-2015 12:39 PM
Exporting Custom tags to PDF lervein PowerPoint 0 09-16-2014 08:55 AM
Viewing Bookmark Tags namedujour Word 2 08-13-2012 09:02 PM
How to use VBA to extract picasa photo captions and tags? For Moderator: Code tags? Ulodesk Forum Support 1 07-12-2011 07:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft