WPCubed Product Support

Some document formats lost on LoadFromString

8.2k Views 3 users read 2 min
support

@WindChaser:
'Then the string is saved to the database. If the user later wants to
'display the document, the following is done:
.Clear False, False
.LoadFromString rtfWPString, True, "WPT"
end with

I marked the problem.

When text is "inserted" the current page format is not changed.

#4 ♥ 0

Thanks for your reply. Specifically, this is what is happening:

With WPDLLInt1.Memo
.LoadFromFile "C:\TestTemplate.rtf", True, "" 'Initial load

'The template is then documented with data and is saved as a string.
rtfWPString = .SaveToString(False, "WPT")

'Then the string is saved to the database. If the user later wants to
'display the document, the following is done:
.Clear False, False
.LoadFromString rtfWPString, True, "WPT"
end with

However, when this is done, the margins of the original document are not respected. Am I forgetting something, consequently preventing the margin data from being saved in the string?

Thanks!

#3 ♥ 0
support

Hello,

bool LoadFromString([In] string Data, [In] bool Insert, [In] string FormatStr);

did you specify true as second parameter to LoadFromString?

If the text is "inserted", the page format is not overwritten.

#2 ♥ 0

Hi folks,

If I load a RTF document using LoadFromFile, all formats and document margins are respected. Then, I use SaveToString in order to store the document to a database. Then, if I try to load the string using LoadFromString, the document margins (among other things) do not match those of the original document. What steps am I missing to ensure a complete match?

Thanks!

#1 ♥ 0