def write_rels(self): """Write the workbook relationships xml.""" styles = Relationship(type='styles', Target='styles.xml') self.rels.append(styles) theme = Relationship(type='theme', Target='theme/theme1.xml') self.rels.append(theme) if self.wb.vba_archive: vba = Relationship(type='', Target='vbaProject.bin') vba.Type = 'http://schemas.microsoft.com/office/2006/relationships/vbaProject' self.rels.append(vba) return tostring(self.rels.to_tree())
def write_workbook_rels(workbook): """Write the workbook relationships xml.""" wb = workbook strings = Relationship(type='sharedStrings', Target='sharedStrings.xml') wb.rels.append(strings) styles = Relationship(type='styles', Target='styles.xml') wb.rels.append(styles) theme = Relationship(type='theme', Target='theme/theme1.xml') wb.rels.append(theme) if workbook.vba_archive: vba = Relationship(type='', Target='vbaProject.bin') vba.Type ='http://schemas.microsoft.com/office/2006/relationships/vbaProject' wb.rels.append(vba) return tostring(wb.rels.to_tree())
def write_workbook_rels(workbook): """Write the workbook relationships xml.""" wb = workbook strings = Relationship(type='sharedStrings', Target='sharedStrings.xml') wb.rels.append(strings) styles = Relationship(type='styles', Target='styles.xml') wb.rels.append(styles) theme = Relationship(type='theme', Target='theme/theme1.xml') wb.rels.append(theme) if workbook.vba_archive: vba = Relationship(type='', Target='vbaProject.bin') vba.Type = 'http://schemas.microsoft.com/office/2006/relationships/vbaProject' wb.rels.append(vba) return tostring(wb.rels.to_tree())