Platforms to show: All Mac Windows Linux Cross-Platform

WordFileMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Wordfile MBS XL Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Word file editing.
Example:
dim f as FolderItem = GetFolderItem("test.docx")
dim b as BinaryStream = BinaryStream.Open(f)
dim d as string = b.Read(b.Length)
dim w as WordFileMBS = WordFileMBS.OpenData(d)

if w.ReplaceTag("FirstName", "Peter") then
if w.ReplaceTag("LastName", "Miller") then

f = GetFolderItem("output.docx")
if w.WriteFile(f) then
MsgBox "OK"
end if
end if
end if
Notes:
This is a class for reading word files and replacing text to customize document files.
Works for xml and docx files. Does not support old doc file format.

Please report document files where plugin corrupted file or failed to replace text.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Feedback, Comments & Corrections

  • 7 properties
  • 17 methods
    • method addMediaFile(name as string, content as string)
    • method Append(other as WordFileMBS, AddPageBreak as boolean = false) as Boolean
    • method AppendTableRow(tag as string) as Integer
    • method Constructor
    • method Contains(findText as string) as boolean
    • method DuplicateTableRow(tag as string) as Integer
    • method FieldNames as String()
    • method GetFieldText(fieldName as string, byref text as String) as boolean
    • method HasTag(tag as string) as boolean
    • method MediaFiles as String()
    • method Parts as String()
    • method RemoveTableRow(tag as string) as Integer
    • method ReplaceTag(tag as string, text as string = "", All as boolean = false) as boolean
    • method SetFieldText(fieldName as string, text as String) as boolean
    • method SetMarkers(openMarker as String, closeMarker as String) as boolean
    • method Substitute(findText as string, replaceText as string = "", All as boolean = false) as boolean
    • method WriteFile(path as folderItem) as boolean
  • 3 shared methods
    • shared method OpenData(Data as MemoryBlock) as WordFileMBS
    • shared method OpenData(Data as String) as WordFileMBS
    • shared method OpenXML(XML as String) as WordFileMBS

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos


The items on this page are in the following plugins: MBS XL Plugin.


WMIObjectMBS   -   X509MBS

The biggest plugin in space...




Links
MBS Xojo Chart Plugins

Start Chat