Secondary Development of visio: Storage Method

Source: Internet
Author: User

 

Recently, I was working on a secondary development project in Visio. I encountered a file storage problem, that is, I could not use save for data storage. After reading the relevant materials, I finally found the answer to the question. Reference: http://msdn.microsoft.com/zh-cn/library/aa168480 (V = office.11). aspx # EIGA

(1)SRCTo load the document to the control. For example, the following C # example shows how to load a Visio drawing:

 
Drawingcontrol. src = "C: \ Drawing. Sealing ";

AvailableSRCProperty to load any Visio file type (for example,. sealing,. vdx,. VST, or. SVG ). This file can be stored locally or on a remote file server. The
SRCThe property is loaded inSRCValue. To save the changes in the control document, you must use
Saveas
To save the Visio Document. Alternatively, you can save the changes in the stream. However, in both casesSRCThe original document loaded by the property.

(2) The control is loadedSRCCopy of the file specified by the property. Files loaded through SRC cannot be used for read/write operations, so they cannot be used.
Save
Method. To save the changes to the document loaded in the Visio Drawing Control, callSaveasMethod. The following C # example shows how to use
DocumentAttribute to callSaveasMethod:

Visio. Document document = drawingcontrol. Document; document. saveas ("C: \ Drawing. Sealing ");

You cannot useSaveasexMethod: Save the Visio 2003 document to the Visio 2002 format in the Visio ActiveX control. To save the drawing loaded in the Visio drawing control to the Visio 2002 format, start an invisible instance of Visio and applyProgramInstance call
SaveasexMethod, like Visual Basic 6.0CodeThis code saves the Visio 2003 drawing to the Visio 2003 file format:

 
Application. Documents (1). saveasex ("C: \ Documents and Settings" & _ "\ myusername \ My Documents ents \ visio2002 file. Sealing", vissaveasws + _ vissaveaslistinmru)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.