L
Landon
I use MFC Visual C++ 4.2.
I need to get all bookmarks in a MS Word file and update them.
I have been successful in getting all the bookmarks name but the problem is
how to update those bookmarks.
I have read from the MS Word macro that the process is to go to that
bookmark and change the value.
My code below has been successfully compiled but when it was going to be
executed, an exception was caught. The exception came from the selObj.GoTo
line. The exception stated that the bookmark does not exist.
How could it be like that? The bookmark's name was correct.
COleVariant vtBookmark( ( short ) -1 ),
vtNext ( ( short ) 2 );
CString sBookmarkName = m_Book.GetName();
selObj.GoTo( vtBookmark, vtNext, COleVariant( vtLoopVar ), sBookmarkName ) );
if( sBookmarkName == "support" )
selObj.TypeText( "123-ABC" );
How to solve it?
Thank you very much.
I need to get all bookmarks in a MS Word file and update them.
I have been successful in getting all the bookmarks name but the problem is
how to update those bookmarks.
I have read from the MS Word macro that the process is to go to that
bookmark and change the value.
My code below has been successfully compiled but when it was going to be
executed, an exception was caught. The exception came from the selObj.GoTo
line. The exception stated that the bookmark does not exist.
How could it be like that? The bookmark's name was correct.
COleVariant vtBookmark( ( short ) -1 ),
vtNext ( ( short ) 2 );
CString sBookmarkName = m_Book.GetName();
selObj.GoTo( vtBookmark, vtNext, COleVariant( vtLoopVar ), sBookmarkName ) );
if( sBookmarkName == "support" )
selObj.TypeText( "123-ABC" );
How to solve it?
Thank you very much.