Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving to a specified location in Visio

Status
Not open for further replies.

Alcedes

Technical User
Mar 25, 2008
46
US
My code allows for reports to be generated based on the suers entries and the drawings that have been automated. Its basically an inventory report of all network assets. Thats not important though.

What I am trying to do is save that file to the desktop. The obvious problem with that is that I cannot possibly predict the names of everyone who may use this.

So when i set the save directory I cannot set it as:

c:\documents and settings\John Doe\Desktop

as that would only work for Mr. Doe. :)


I know that the windows global for desktop is something like %DESKTOPDIR%...Well, since there is a windows global variable that fetches the current users desktop path, is there anyway to get VB to utilize it?
 
woot! figured this one out! sure was easy. just different than the standard vb.net/6 way of doing it. :)


Set Wshshell = CreateObject("WScript.Shell")
DesktopPath = Wshshell.SpecialFolders("Desktop")
exportfile = DesktopPath & "\" & reportname & ".xls"
MsgBox (exportfile)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top