# Document header move the content to down.

• ### Question

• Hi There,

if textbox, table positioned on the top of page as shown in below first image.

And when we access the header from vba or .net and save the document then position of textbox or table changed and it move down as showing in second image below.

Following is the sample code to produce the issue, i also have word document to produce the issue but don't know how to attached. Please let me know if that doc need  and how can i send that? :

Dim wrdApp As Microsoft.Office.Interop.Word.Application = Nothing
Dim wrdDoc As Microsoft.Office.Interop.Word.Document = Nothing
Try
wrdApp = CType(CreateObject("Word.Application"), Microsoft.Office.Interop.Word.Application)
wrdApp.Visible = True
Dim docPath As String = System.AppDomain.CurrentDomain.BaseDirectory & "test.DOC"
wrdDoc = wrdApp.Documents.Open(docPath)
wrdDoc.Select()
wrdDoc.Save()
Finally
'If wrdApp IsNot Nothing Then
'    wrdApp.Quit(Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges)
'End If
End Try

Why the textbox move down and how to avoid it?

Actual application is different and there are different kind of documents and we are access different area of documents (headerfooters, document ranges, shapes etc.)

Thanks

Dalbir Singh

• Edited by Thursday, November 27, 2014 5:25 PM
Thursday, November 27, 2014 8:17 AM

### All replies

• Hi Dalbir Singh,

I was able to reproduce this issue.

And as far as I test, the extra top blank is the area of page header, we can double click it and after we close the header and footer, the blank area disapear.

Here is the workaround to get the stroy type from the range of header:

 Sub GetStoryType()
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub


Please let me know whether it works for you.

Regards & Fei

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Friday, November 28, 2014 5:48 AM

Issue is still there. The example mentioned in this thread is just to produce the issue. We don't only need story type.

In real application, we are accessing text, fields etc from  headers\footers , footnote\end note etc put in the document by the client.

main issue is with header\footer, when we loop through it then that header's area don't get collapse as we do manually by double click out of the header.

Friday, November 28, 2014 10:51 AM
• Hi Dalbir Singh,

Since the issue is complex, I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

Sorry for any inconvenience and have a nice day!

Regards & Fei

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Monday, December 1, 2014 8:32 AM
• Thanks for looking into this issue deeply and involving your senior engineers.

Tuesday, December 2, 2014 3:44 AM
• Hi Dalbir Singh,

I was able to reproduce the issue with the document you had provided. However, I tried to create a similar document using Office 2013 and I was not able to reproduce the issue.

Can you provide the steps to create a sample document to repro the issue?

Also please share the version of Office which you are using to create the document.

Regards,

Anush.

Tuesday, December 16, 2014 10:40 PM
• Hi Anush,