Import image

Started by Lars-Erik, July 01, 2008, 08:15:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lars-Erik

I have some spare time and started working on a fun project.
I'll share more later :)

I have a shape with a picture in it, users need to be able to replace the picture with one they can browse for. The shape should, if possible keep its size and its place inside a group. Is there a way to call for a browse screen or do i need to create form for this type of action.

- Lars

Lars-Erik

Ok, I've found some info, but it doesnt work :)

    Dim dlgOpen As FileDialog
    Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
    With dlgOpen
        .AllowMultiSelect = True
        .Show
    End With


The property of method is not supported by this object...

Source: http://msdn.microsoft.com/en-us/library/aa213120(office.11).aspx

Visio Guy

I think that the FileDialog is in Excel and Word, but not Visio. You need to find the VBA code that leverages the built-in common dialogs, I think.

This one might work, without having to use and COM controls:

http://officeone.mvps.org/vba/display_file_open_common_dialog.html
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Lars-Erik

Cheers!
That works like a charm (Put it in a module though, not in a form  ::) )