gord

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 6 Imported by: 1

README

gord

Gord is a library to operate Word using go-ole library.

REFERENCES

See also

  • Goxcel
    • Goxcel is a library to operate Excel using go-ole library.

Documentation

Overview

Package gord is a library to operate Word made in Golang. This library works only on Windows.

Gord is the main struct in this library. NewGord() is the staring point.

References:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGord

func InitGord() (func(), error)

func MustInitGord

func MustInitGord() func()

func MustNewGord

func MustNewGord() (*Gord, ReleaseFunc)

func NewDocument

func NewDocument(docs *Documents, doc *ole.IDispatch) (*Document, ReleaseFunc)

func NewGord

func NewGord() (*Gord, ReleaseFunc, error)

Types

type ComReleaser

type ComReleaser interface {
	HasReleaser
	HasComObject
}

noinspection GoNameStartsWithPackageName

type Document

type Document struct {
	// contains filtered or unexported fields
}

func (*Document) Close

func (w *Document) Close() error

func (*Document) ComObject

func (w *Document) ComObject() *ole.IDispatch

func (*Document) ExportAsFixedFormat

func (w *Document) ExportAsFixedFormat(path string, fmtType constants.WdExportFormat) error

func (*Document) Gord

func (w *Document) Gord() *Gord

func (*Document) PrintOut

func (w *Document) PrintOut() error

func (*Document) Releaser

func (w *Document) Releaser() *Releaser

func (*Document) Save

func (w *Document) Save() error

func (*Document) SaveAs2

func (w *Document) SaveAs2(filePath string, format constants.WdSaveFormat) error

func (*Document) SaveAsWithFileFormat

func (w *Document) SaveAsWithFileFormat(filePath string, format constants.WdSaveFormat) error

func (*Document) SetSaved

func (w *Document) SetSaved(value bool) error

type Documents

type Documents struct {
	// contains filtered or unexported fields
}

func NewDocuments

func NewDocuments(g *Gord, docs *ole.IDispatch) *Documents

func (*Documents) Add

func (d *Documents) Add() (*Document, ReleaseFunc, error)

func (*Documents) ComObject

func (d *Documents) ComObject() *ole.IDispatch

func (*Documents) Gord

func (d *Documents) Gord() *Gord

func (*Documents) MustOpen

func (d *Documents) MustOpen(filePath string) (*Document, ReleaseFunc)

func (*Documents) Open

func (d *Documents) Open(filePath string) (*Document, ReleaseFunc, error)

func (*Documents) Releaser

func (d *Documents) Releaser() *Releaser

type Gord

type Gord struct {
	// contains filtered or unexported fields
}

func (*Gord) ActiveDocument

func (g *Gord) ActiveDocument() (*Document, ReleaseFunc, error)

func (*Gord) ActiveWindow

func (g *Gord) ActiveWindow() (*Window, error)

func (*Gord) ComObject

func (g *Gord) ComObject() *ole.IDispatch

func (*Gord) DisplayAlerts

func (g *Gord) DisplayAlerts() (bool, error)

func (*Gord) Documents

func (g *Gord) Documents() (*Documents, error)

func (*Gord) EnableEvents

func (g *Gord) EnableEvents() (bool, error)

func (*Gord) Gord

func (g *Gord) Gord() *Gord

func (*Gord) MustDocuments

func (g *Gord) MustDocuments() *Documents

func (*Gord) MustSetVisible

func (g *Gord) MustSetVisible(value bool)

func (*Gord) MustSilent

func (g *Gord) MustSilent(visible bool)

func (*Gord) Releaser

func (g *Gord) Releaser() *Releaser

func (*Gord) ScreenUpdating

func (g *Gord) ScreenUpdating() (bool, error)

func (*Gord) SetDisplayAlerts

func (g *Gord) SetDisplayAlerts(value bool) error

func (*Gord) SetEnableEvents

func (g *Gord) SetEnableEvents(value bool) error

func (*Gord) SetScreenUpdating

func (g *Gord) SetScreenUpdating(value bool) error

func (*Gord) SetVisible

func (g *Gord) SetVisible(value bool) error

func (*Gord) Silent

func (g *Gord) Silent(visible bool) error

type GordObject

type GordObject interface {
	HasGord
	ComReleaser
}

noinspection GoNameStartsWithPackageName

type HasComObject

type HasComObject interface {
	ComObject() *ole.IDispatch
}

noinspection GoNameStartsWithPackageName

type HasGord

type HasGord interface {
	Gord() *Gord
}

noinspection GoNameStartsWithPackageName

type HasReleaser

type HasReleaser interface {
	Releaser() *Releaser
}

noinspection GoNameStartsWithPackageName

type ReleaseFunc

type ReleaseFunc func()

type Releaser

type Releaser struct {
	// contains filtered or unexported fields
}

func NewReleaser

func NewReleaser() *Releaser

func (*Releaser) Add

func (r *Releaser) Add(f func() error)

func (*Releaser) Count

func (r *Releaser) Count() int

func (*Releaser) Release

func (r *Releaser) Release() error

type Window

type Window struct {
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow(g *Gord, w *ole.IDispatch) *Window

func (*Window) ComObject

func (w *Window) ComObject() *ole.IDispatch

func (*Window) Gord

func (w *Window) Gord() *Gord

func (*Window) Releaser

func (w *Window) Releaser() *Releaser

func (*Window) SetZoom

func (w *Window) SetZoom(zoomRate int) error

Directories

Path Synopsis
Package constants パッケージには、Visual Basic の Word列挙体の一覧が定義されています。
Package constants パッケージには、Visual Basic の Word列挙体の一覧が定義されています。
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL