hello,
i extended the code from post
http://www.eileenslounge.com/viewtopic.php?f=27&t=24130" onclick="window.open(this.href);return false;
a little bit, so it is now possible to insert pictures into the org chart by code. Is there any possible way to insert the picture in another format instead of .bmp - to get a higher resolution into the stoplight display? Now the shapes are stored temporarily as a bmp and are inserted as .bmp.
When i changed all the .bmp points of the code into .emf, nothing happened, it stayed the same....
Does anyone know how to overcome a question like this?
Smart Art Org Chart with picture
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Smart Art Org Chart with picture
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Smart Art Org Chart with picture
Why don't you store the pictures in your preferred format in the same folder as the workbook? You can then use them in lines such as
QChild.Shapes(2).Fill.UserPicture ...
and you won't need to store the pictures in the worksheet and export them.
QChild.Shapes(2).Fill.UserPicture ...
and you won't need to store the pictures in the worksheet and export them.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Smart Art Org Chart with picture
ok, but if i change:
QNode.Shapes(2).Fill.UserPicture (GetWinTemp & "\img0.bmp")
Else
QNode.Shapes(2).Fill.UserPicture (GetWinTemp & "\img" & Range("D1").Value & ".bmp")
End If
which file format shall i take then? .emf .wmf or what? and do i have to adress the worksheet Master Data. I am not very good with VBA so i figured out the dialogue from stephen Bullen to insert a picture...
moreover, i wanted to give the file away, so anyone could use it, so i took the file folder temp.
QNode.Shapes(2).Fill.UserPicture (GetWinTemp & "\img0.bmp")
Else
QNode.Shapes(2).Fill.UserPicture (GetWinTemp & "\img" & Range("D1").Value & ".bmp")
End If
which file format shall i take then? .emf .wmf or what? and do i have to adress the worksheet Master Data. I am not very good with VBA so i figured out the dialogue from stephen Bullen to insert a picture...
moreover, i wanted to give the file away, so anyone could use it, so i took the file folder temp.
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Smart Art Org Chart with picture
If you permanently store the pictures in the same folder as the workbook, instead of in the Master Data sheet, you don't need the CreatePics code, nor the code in the CopyImage module. You can simply use
QNode.Shapes(2).Fill.UserPicture ThisWorkbook.Path & "\img0.png"
if you use .png files, or
QNode.Shapes(2).Fill.UserPicture ThisWorkbook.Path & "\img0.emf"
if you use .emf files, etc. The .emf format has the advantage that it is a vector format, so it scales better than pixel formats such as .bmp, .png and .jpg. But for images in an organization chart that may not make much difference.
QNode.Shapes(2).Fill.UserPicture ThisWorkbook.Path & "\img0.png"
if you use .png files, or
QNode.Shapes(2).Fill.UserPicture ThisWorkbook.Path & "\img0.emf"
if you use .emf files, etc. The .emf format has the advantage that it is a vector format, so it scales better than pixel formats such as .bmp, .png and .jpg. But for images in an organization chart that may not make much difference.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Smart Art Org Chart with picture
ok, i tried, i exchanged, .bmp to .emf, in the code (13 times), but i still inserted the .bmp picture....
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Smart Art Org Chart with picture
13 times? That implies that you're still using the CreatePics code. I suggested to stop using that.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Smart Art Org Chart with picture
The correct question should have been (on my side) how to do it?
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Smart Art Org Chart with picture
to adopt the code that the macro does not store the picture.
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Smart Art Org Chart with picture
1) Store the pictures that you want to use in the same folder as the workbook, with the appropriate names.
2) Remove the line Call CreatePics from the org macro.
3) Change the extension .bmp to the extension of the files that you stored in step 1) in the org macro and in the AddChildren procedure.
2) Remove the line Call CreatePics from the org macro.
3) Change the extension .bmp to the extension of the files that you stored in step 1) in the org macro and in the AddChildren procedure.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Smart Art Org Chart with picture
i think i must store them into the temp folder.
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Smart Art Org Chart with picture
If you must do that, change ThisWorkbook.Path back to GetWinTemp.
Best wishes,
Hans
Hans