Give file name to pngout

Give file name to pngout

aridzv
Enthusiast Enthusiast
294 Views
2 Replies
Message 1 of 3

Give file name to pngout

aridzv
Enthusiast
Enthusiast

Hi.

I need to use pngout command and give it a filename alredy stored in a varaible named "filename".

I searched for this issue but found no answer.

I use this line of code to lunch the pngou command:

ThisDrawing.SendCommand ("pngout" & vbCr)

at that point I get the "Save File" window.

How d I send the "filename" varible to the file name field in the save file window and simulate enter?

 

thanks,

aridzv

0 Likes
Accepted solutions (1)
295 Views
2 Replies
Replies (2)
Message 2 of 3

Ed__Jobe
Mentor
Mentor
Accepted solution

Whenever you need to respond to a file dialog programmatically, you can turn the dialog off by setting FILEDIA = 0. Then your code would look like 

ThisDrawing.SetVar "fildia" 0
ThisDrawing.SendCommand "pngout " & filename & vbCr
ThisDrawing.SetVar "fildia" 1

Note the space after pngout

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 3

aridzv
Enthusiast
Enthusiast

Thanks!!!💪

 EDIT:

the line with the space in the pngout didnt work for me so I use it without the space...

ThisDrawing.SendCommand ("PNGOUT" & vbCr & fileName & vbCr)