Not sure what you want to do after opening but I have some code that
extracts a time range out of a date tree. Maybe you can reuse the
searching parts ...
(defun mp26/org-find-headline-prefix-in-buffer (heading optional buffer
Find node with heading-prefix HEADING in BUFFER.
Return a marker to the heading if it was found, or nil if not.
If POS-ONLY is set, return just the position instead of a marker.
The heading prefix must match as prefix of the full headline. It
may have a TODO keyword, a priority cookie and tags in the
(with-current-buffer (or buffer (current-buffer))
(concat (regexp-quote heading) .*)) nil t)
(move-marker (make-marker) (match-beginning 0)
(defun mp26/org-week-from-journal ()
Insert a copy of the current week from the journal.
(loop for days in '(-6 -5 -4 -3 -2 -1 0)
(let* ((date (calendar-current-date days))
(nth 2 date) (nth 0 date) (nth 1 date
(setq pos (mp26/org-find-headline-prefix-in-buffer
date-string nil t))