Word Document Properties


Part III: Expanding Your VBA Horizons



Download 8,82 Mb.
Pdf ko'rish
bet200/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   196   197   198   199   200   201   202   203   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Part III: Expanding Your VBA Horizons 
17_046500 ch11.qxp 12/5/06 5:37 PM Page 242


When you don’t need to save all the information provided by WordML and
you don’t want to create a special template to do the job, you can rely on
XSLT to transform your data into standard XML. The benefit of using this
technique is that it’s faster than using a specialized template. The problem
with using this technique is that you can’t rely on it to provide complete data
translation if you don’t use the correct tags or if the XSLT file isn’t formatted
correctly. See the upcoming “Saving your Word document by using XSLT” sec-
tion for details on using this technique.
Manipulating XML Data
Microsoft is making it easier to create, change, delete, import, and export
XML by using Office products. XML makes it easier to manage data on the
Internet and also to exchange data with other people. This section demon-
strates several ways to work with XML data by using Office.
Writing the data to disk
The easiest way to export your data to disk is to save it as an XML document
by using the 
SaveAs
method. Here’s an example of this method:
Public Sub OutputInventory()
‘ Use the standard SaveAs method to export XML.
Sheet1.SaveAs “ExcelXML.XML”, xlXMLSpreadsheet
End Sub
You can also accomplish this task by choosing the File

Save As command.
The advantage of this method is that you can concentrate on a single work-
sheet, a set of records, or an area of a document rather than save the whole
document. The first argument is the filename. The second argument varies by
Office application. Excel uses the 
xlXMLSpreadsheet
to create XML output,
and Word uses the 
wdFormatXML
constant.
The only problem with this technique is that it saves only the content and
information about the content. Figure 11-2 shows some typical output for Word
when using this method. This method works best if you plan to manipulate the
data outside Office by using another program, interpret the data by using XSLT,
or require portions of the data where interpretation isn’t required.
Defining a schema

schema
is a definition of the structure of your data. You can look at the data
and figure out the structure, but the computer can’t — it needs additional
243

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   196   197   198   199   200   201   202   203   ...   207




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish