I am maintaining a set of process diagrams in visio 2007. For viewing I save the files as HTML and publish them on a web server.
It works great but its a real pain to maintain (a paintain ;-).
I am looking for a way to do this as some kind of batch job, currently the process is:
open each file
file>save as web page
in the save as web page dialogue:
select location
publish > open new dialogue
change title (i dont mind if i have to miss that step)
select web page to insert it into (my template)
done
The tools I have availiable are:
Visual studio 2010 express (i prefer c# but whatever)
Visio 2007(i have another laptop with visio 2010 which i can use too but the source files will be 2007 - that's not changing for the moment)
Ruby - may be easier if it doesn't require office integration.
(BTW I know about process repository in OSS 2010 and i have tested it with visio 2010 web diagrams - that works and would probably be a better option for anyone who has the choice, though its not perfect)
(batch file or command line would also be cool but i have not found a way of saving as web page from command line)
You can use Visio's COM interop API to do what you want (I think). I'd start by just recording a macro while manually doing the export, and then look at the VBA code that generates. You could then adapt that in C#, or VBScript/VB6 if you want something you can call with a command shell.
As Jon highlights, there's a whole API for using the SaveAsWeb functionality from code. I wrote a post about it a little while ago, which you can see here:
http://visualsignals.typepad.co.uk/vislog/2010/03/automating-visios-save-as-web-output.html
The post is VBA based but the .net version is very similar and there's also examples in the Visio 2010 SDK:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=12365
Related
Objective:
I have a Web Application.
I have some Microsoft Visio files present in my Application.
I want to process (edit/export/print) these Visio files (Note: Opensource tools like LibreOffice Draw are not giving the same quality like Visio)
Current Progress: I got to know about Microsoft VSTO and achieved some basic operation by using VSTO
Sample code of VSTO
string docPath = "input.vsdx";
this.Application.Documents.Open(docPath);
int pageIndex = 1;
Visio.Pages visioDocPages = this.Application.ActiveDocument.Pages;
if (pageIndex <= visioDocPages.Count) {
// Use `visioDocPages[pageIndex]` for some processing
}
this.Application.ActiveDocument.Close();
Queries:
VSTO seems to be an Automation library, so I fear it will fail when multiple files needs to be processed from a Server
Are there any other methods to work on visio (like edit, export, print, etc) from a Server environment
Am looking for either officail Microsoft packages OR Open Source ones (NOT looking for paid packages like https://products.aspose.com/diagram/net/)
VSTO is a layer on top of the COM addin API useful only for developing Office addins. It cannot be used from external applications.
No Office applications (Visio included) can be used from a service (such as IIS). Look at the Open XML API (https://learn.microsoft.com/en-us/office/client-developer/visio/how-to-manipulate-the-visio-file-format-programmatically) - it will let you manipulate vsdx files without Visio.
I have a lightswitch project in visual studio 2013, using vb.net. I would like the user to be able to click a button and have lightswitch find an excel file, and upload that file to a sql table according to a pre-determined column mapping.
My preference was to use the Office Integration extension for visual studio, which I got working with VS 2013 by downloading it from this link: http://www.ge.tt/71iuRQv/v/0
However, the documentation and examples for office integration seem to be very heavy on getting an excel spreadsheet into a display in the lightswitch web client, rather than into the sql data table, which is where I need it. Here are the examples I've been following:
http://blogs.msdn.com/b/bethmassi/archive/2012/07/18/new-and-improved-office-integration-pack-extension-for-lightswitch.aspx
Alternatively, I have an existing stored procedure, and I can request that the server call this stored proc by sending a web API extension from the client to the server. I have this working already for other stored procs, according to examples from Beth Masi and Paul van Bladel. (Stackoverflow won't let me post the links...)
The undesirable part of this approach is that the stored proc is old, and messy.
I've searched and searched, but have yet to find anyone approach this problem for VS 2013 with lightswitch. Any useful advice?
I've used the method detailed by Matt Sampson to store word files and it works very well. Since it just stores the raw binary it should handle Excel files just as well.
If you're creating the table in LightSwitch, use the Binary Type. If you use SQL create scripts use varbinary(MAX).
You need to create a custom Silverlight dialog box to gain access to the OpenFileDialog object. Then open the file in as a FileStream.
Finally, you need to add a handler for the closed method of the control and then show the control to the user. Most likely done in a button. This needs to be done on the main dispatcher.
The code examples are in C# but I just used one of the many available translators out on the web and copy/pasted the VB.NET code.
Another option might be to consider shelling out to the DTSEXEC run-time to execute an SSIS package to perform the upload - especially if the target Excel spreadsheets have predefined layouts and content data types.
Even simpler, you might be able to use the SQL Server BULK INSERT command to get the job done - although that would require a SQL Client connection to your database.
HTH
I'm new here and more than beginner in coding. I want, as an "on the side" project, create a tool coded in VB for the helpdesk team. I would like to type the computer ID in a text field and have several buttons below that performs windows command like ping, getmac, wmic, etc etc..
How is it possible to load or to integrate a windows prompt or even to as VB to call the dll to perform those windows commands. Is there a built-in tool in Visual Studio 12 that does that? I thought that it was the "Console" argument that could do this but I'm just way too n00b in coding to have it working.
Any help would be greatly appreciated!
For creating forms read this MSDN article: http://msdn.microsoft.com/en-us/library/vstudio/dd492132.aspx
For executing processes use Process.Start.
If you need to read process output, see Process.start: how to get the output?
A good tutorial to start with : http://www.dotnetperls.com/process-start-vbnet
I'm working with Visual Studio 2010 and Sharepoint 2010. I would like to know if there's a way to have a web part that crawls all the data within a SharePoint site so I can save it into a custom db.
You can certainly create a custom web part that will do this. I do not know of an out of the box web part that will work. I began writing something like this when I found SharePoint List Source and Destination. It's a CodePlex project for an SSIS SharePoint adapter. We did not need a user interface for the extract, so we used it successfully last year for transferring data between SQL Server and SharePoint.
Sounds like all you need to do is use the API, OOB web services, or the Client OM to write some code and access the lists directly. Which approach you take depends mostly on where the code will run.
Well I found this article - Document Library Tree View Web Part for SharePoint - it is a Web Part that shows all the info of any of the document libraries within a site. At least I know how to crawl that kind of library.
We have a document library that is built inhouse. We are migrating to SharePoint 2010 Document Library, but this will be a time consuming process and many very old documents may not get moved to SharePoint at all. I would like to provide the same experience for our users when they open a document from SharePoint or our legacy system. The behavior I would like is like when you open a Workbook or Document that is rendered in the browser using the "Open In Excel" and "Open in Word" button that you get when you open a document stored in a Share Point Document Library.
I am not sure what this technology is called or where to start looking to configure this or integrate into an addin.
Any starting points are much appreciated.
I'm not exactly clear on what your question is, but perhaps you are looking to use the Office Web Apps. This allows you to use the Office applications within the browser.