![]() |
#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! |
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 |
![]() |
namedujour | Word | 2 | 08-13-2012 09:02 PM |
![]() |
Ulodesk | Forum Support | 1 | 07-12-2011 07:54 AM |