Get logged in users image for use in word document?

I want to get the currently logged in users user image, and save it or directly place it into a word document (Either method is fine). I found some c# code that shows how to do it, but am trying to figure out how this would be done as part of the automation without creating a .dll file to use in my project. I have never used a .dat file before so I am a little lost.

This is the solution I found for c#:

@LeftBrainCo,

System.Drawing.image.FromFile(system.Environment.UserName)

Try this and let me know if it works :slight_smile:

It gives me an error. I think System.Drawing.image.FromFile() requires a string for file location. The problem I am having is the file is stored as a .dat file. My understanding is a .dat is unstructured so you have to push the bit rate for it before saving as a .bmp file (This is my first time ever messing with .dat files). I would love to have a super fast way of pulling the image, however there is another way using the user config panel and taking a screen shot of the image.

Yes, it needs a string and ofcourse we are giving the string. That should work, try using save image activity and give that in the image and a path to save the file.

And one more thing is , if you have only the image in .dat file, try changing the extension to .jpg or png and check if it works. If so, then use move file activity to move the file and change the extension to your requirement and that you can use anywhere :slight_smile: