R/deleteBookmark.R

Defines functions deleteBookmark deleteBookmarkNextContent

Documented in deleteBookmark deleteBookmarkNextContent

#' @title delete a bookmark into a docx object
#'
#' @description delete a bookmark into a docx object
#' 
#' @param doc Object of class \code{\link{docx}}
#' @param bookmark a character vector specifying bookmark id to delete
#' @export
#' @seealso \code{\link{docx}}
deleteBookmark = function( doc, bookmark ){
	
	if( !inherits( doc, c("docx" ) ) )
		stop("doc is not a docx object.")

	if( missing( bookmark ) ) stop("bookmark is missing")

	if( !is.character( bookmark ) )
		stop( "bookmark must be a single character value")
	
	if( length(bookmark) != 1 ){
		stop( "bookmark must be a single character value")
	}
	
	.jcall( doc$obj, "V", "deleteBookmark", bookmark )
	doc
}



#' @title delete first content after a bookmark into a docx object
#'
#' @description delete first content after a bookmark into a docx object
#' 
#' @param doc Object of class \code{\link{docx}}
#' @param bookmark a character vector specifying bookmark id to delete
#' @export
#' @seealso \code{\link{docx}}
deleteBookmarkNextContent = function( doc, bookmark ){
	
	if( !inherits( doc, c("docx" ) ) )
		stop("doc is not a docx object.")
	
	if( missing( bookmark ) ) stop("bookmark is missing")
	
	if( !is.character( bookmark ) )
		stop( "bookmark must be a single character value")
	
	if( length(bookmark) != 1 ){
		stop( "bookmark must be a single character value")
	}
	
	.jcall( doc$obj, "V", "deleteBookmarkNextContent", bookmark )
	doc
}

Try the ReporteRs package in your browser

Any scripts or data that you put into this service are public.

ReporteRs documentation built on April 1, 2018, 12:06 p.m.