![]() |
#1
|
|||
|
|||
![]()
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! |
#2
|
||||
|
||||
![]()
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] |
![]() |
Tags |
caption, photo |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
Ulodesk | Forum Support | 1 | 07-12-2011 07:54 AM |