View Single Post
 
Old 10-21-2021, 06:10 AM
RedZed1100 RedZed1100 is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2020
Location: England
Posts: 8
RedZed1100 is on a distinguished road
Default VBA to convert input data to network path?

Hello forum

Admin/ Macropod - Apologies if not correct submission format. Was unsure whether to add on to Macropods original post or create a new thread as a new subject? I'm sure you will advise accordingly. Thanks.

Yesterday I came across Macropod's excellent VBA for inserting pics to a doc.
https://www.msofficeforums.com/newth...newthread&f=23

For my needs, I replaced the columns and picture size with a fixed number...
However, as I have a very large collection of pictures, rather than mouse navigating to selecting the pictures, I want to use VBA to request a file number in the format nnnn/nn/nnnn and convert the number to complete a file path to where the required images are stored as Path = S:\\images\pictures\nnnnnn\nnnn\

Eg user inputs a reference number in the format 3342/21/0019
This number is then converted into the network path location of a folder which contains three jpegs
Path = S:\\images\pictures\334221\0019\
These three jpgs are then selected and copied to a word document as per Macropods VBA.
As an aside, the first digits in the reference number prior to the first "/" can be variable in length and contain a mix of numbers and letters.
I've been fiddling around with message boxes but to be honest I have no idea how to even start.
Any of you guys able to give me a steer?
Many thanks
Attached Files
File Type: docm Insert 3 pics into Documnet.docm (20.2 KB, 4 views)
Reply With Quote