Group:  Other Microsoft Office Products ยป microsoft.public.onenote
Thread: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API

Geek News

Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
benmca[ at ]gmail.com 3/26/2007 4:55:56 PM
Hi - I'm trying to add a new notebook in OneNote 2007 using
UpdateHierarchy, and am having trouble. I have tried to send the
following xml fragments in to the UpdateHierarchy method:

Frag 1:

<one:Notebook xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote" nickname="NicknametestNotebook" ID="{0B8E7305-
AC2C-4BCB-8651-1CDA55AAE14C}{1}{B0}" name="testNotebook"
lastModifiedTime="2007-03-26T09:43:37.5000000-07:00" />

Frag 2:

<one:Notebooks xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote">
<one:Notebook xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote" nickname="NicknametestNotebook" ID="{0B8E7305-
AC2C-4BCB-8651-1CDA55AAE14C}{1}{B0}" name="testNotebook"
lastModifiedTime="2007-03-26T09:43:37.5000000-07:00" />
</one:Notebooks>

Frag 3:
<one:Notebook xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote" nickname="NicknametestNotebook" name="testNotebook"
lastModifiedTime="2007-03-26T09:43:37.5000000-07:00" />

Frag 4:
<one:Notebooks xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote">
<one:Notebook xmlns:one="http://schemas.microsoft.com/office/onenote/
2007/onenote" nickname="NicknametestNotebook" name="testNotebook"
lastModifiedTime="2007-03-26T09:43:37.5000000-07:00" />
</one:Notebooks>

and all return hrNotebookDoesNotExist (0x80042015). Can anyone offer
advice here? I need to programatically add a new notebook,
specifiying it's name and, preferably, it's ID.


Thanks in advance,
Ben

Re: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
Ilya Koulchin <ikoulchine[ at ]hotmail.com> 3/26/2007 6:05:10 PM
benmca[ at ]gmail.com wrote:
[Quoted Text]
> Hi - I'm trying to add a new notebook in OneNote 2007 using
> UpdateHierarchy, and am having trouble. I have tried to send the
> following xml fragments in to the UpdateHierarchy method:

You need to tell OneNote where the notebook you're trying to open is
located in the filesystem. Without you providing the path to the
notebook, OneNote is unable to determine where it should be located, and
will be unable to open it.

> I need to programatically add a new notebook,
> specifiying it's name and, preferably, it's ID.

Is there a particular reason you want a specific ID?

Ilya
Re: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
Grant Robertson <BOGUS[ at ]BOGUS.com> 3/27/2007 12:56:38 AM
Shouldn't all this be in the OneNote developers newsgroup?
Re: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
"benmca[ at ]gmail.com" <benmca[ at ]gmail.com> 3/27/2007 5:40:15 PM
On Mar 26, 5:56 pm, Grant Robertson <B...[ at ]BOGUS.com> wrote:
[Quoted Text]
> Shouldn't all this be in the OneNote developers newsgroup?

Sorry - I didn't see one - point me in the right direction and I'll
repost :)

Thanks,
b

Re: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
"benmca[ at ]gmail.com" <benmca[ at ]gmail.com> 3/27/2007 6:23:33 PM
Thank you for the hint, Ilya - for anyone else curious, here's my
code:

<snip>
string nbName = "name of notebook";
string specialLocationPath;

_app.GetSpecialLocation(SpecialLocation.slDefaultNotebookFolder, out
specialLocationPath);

string newNotebookPath = specialLocationPath + "\\" +
nbName;

string objId;
_app.OpenHierarchy(newNotebookPath, "", out objId,
CreateFileType.cftNotebook);
</snip>

I was going to squirrel away data within the Notebook Id that would be
global to the notebook. If there were Metadata at this level (if
Notebook had a sequence of type Meta) that would work, but there is
not.
b


On Mar 26, 11:05 am, Ilya Koulchin <ikoulch...[ at ]hotmail.com> wrote:
[Quoted Text]
> ben...[ at ]gmail.com wrote:
> > Hi - I'm trying to add a new notebook in OneNote 2007 using
> > UpdateHierarchy, and am having trouble. I have tried to send the
> > following xml fragments in to the UpdateHierarchy method:
>
> You need to tell OneNote where the notebook you're trying to open is
> located in the filesystem. Without you providing the path to the
> notebook, OneNote is unable to determine where it should be located, and
> will be unable to open it.
>
> > I need to programatically add a new notebook,
> > specifiying it's name and, preferably, it's ID.
>
> Is there a particular reason you want a specific ID?
>
> Ilya


Re: Adding a new Notebook with UpdateHierarchy - OneNote 2007 API
"Daniel Escapa [MS]" <notreal[ at ]microsoft.com> 3/28/2007 10:49:52 PM
We don't have one, please just use this newsgroup.

If the volume gets high we can look into some other solution.

<benmca[ at ]gmail.com> wrote in message
news:1175017215.497680.257710[ at ]e65g2000hsc.googlegroups.com...
[Quoted Text]
> On Mar 26, 5:56 pm, Grant Robertson <B...[ at ]BOGUS.com> wrote:
>> Shouldn't all this be in the OneNote developers newsgroup?
>
> Sorry - I didn't see one - point me in the right direction and I'll
> repost :)
>
> Thanks,
> b
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net